PDA

View Full Version : Retrieve selected SQL Server



leesouth
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;
endif;

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

Thanks

jamosedwards
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:

[IS_SQLSERVER_SERVER]

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

James

leesouth
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?


MessageBox ("[IS_SQLSERVER_SERVER] " + @IS_SQLSERVER_SERVER, INFORMATION);

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

RobertDickau
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...

darksander
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?

RobertDickau
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.