View Full Version : Retrieve selected SQL Server

06-29-2006, 04:42 AM
Im using the OnSQLLogin built in dialog box to get the user to select a server and log in. Id like to access the value of the server that the user selects but I dont know how.

nResult = OnSQLLogin( nResult );
if( nResult = BACK ) then
goto Dlg_SdAskDestPath;

Assuming that loggin in goes ok does anyone know how I can access which server was chosen?


06-29-2006, 05:15 AM
I'm doing something similar in a basic MSI project and I am getting the selected SQL server instance by retrieving the following:


I'm new to Installshield, so not sure if this is what you need, but hope it helps.


06-29-2006, 05:53 AM
Thanks for the reply. That variable looks as if it is probably the right one as Ive noticed initially its set to (local).

Anyone any idea how I actually use these values in InstallScript though?


How would I put the value out in a message box or use it in an if statement?

06-29-2006, 09:23 AM
After your script calls SQLServerSelectLogin or SQLServerSelect, the variable in the first argument (sServer, in the default script) should contain the selected SQL server name...

11-22-2006, 05:58 AM
but, what if I actually use the OnSQLLogin function.. not SQLServerSelect.. where is the server name stored in this situation?

11-22-2006, 09:35 AM
I don't have firsthand experience with it, but looking at the default code for OnSQLLogin it seems it too uses IS_SQLSERVER_SERVER for the server name.