distal-attribute
distal-attribute
distal-attribute
distal-attribute

Windows Desktop Shortcut that can take a user right to a query.

feinstev posted 2 years ago in General
Is there anyway a user can execute a command file from within Windows, by using a CMD file, that would execute the program, log them in, identify the database, and take them to a specific query in the database. I'm converting right now from an old Access system I had put together, and would like to duplicate this feature with HeidiSQL.

Thanks,
jfalch posted 2 years ago
create a link (.lnk) to the heidisql.exe file, add parameter -d "name_of_stored_session" to the call, using the name of a session stored from heidisql´s session manager. This is the simplest method; all other db access paramters sre part of the session definition, set from the session manager.

Alternative is using one or several of -h "hostname" -P "port" -u "user" -p "password" -D "database_name". You can try and omit the quotes unless the value contains space, quote or other unusual characters. Also -P is usually not necessary (defaults to 3306).
feinstev posted 2 years ago
Thank you. So that gets me to the Database name. But I'm greedy, I want more. Can it take me to a specific query within that database, and then to the DATA Tab?
ansgar posted 2 years ago
No, HeidiSQL has only the above mentioned parameters, which are documented in the readme file (see Help > Readme)
jfalch posted 2 years ago
You cannot specify a query, but you may specify an .sql file name as last parameter - this will open the file, load its contents into a query tab, and make this the current tab (F9 will then execute it).
It is, alas, not possible to specify a parameter to make the Data tab the current one (sigh)...
ansgar posted 2 years ago
feinstev, I just tried to send you a pm to thank you for your donation, but the mail was bounced with a "550 Previous (cached) callout verification failure (state 13)". If you wish I can add a link to your website here on the donators page, if you want.

Please login to leave a reply, or register at first.