cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tcom36
Level 7

Hiding SQLServerSelectLoginDlg?

I am still pretty new to InstallShield 2008.

I am making an InstallScript MSI project in which, after installing the DB engine and the application, I want to call an SQL script to generate the DB schema for the application.

Under SQL Scripts, I have added the script with the relevant settings to connect to the SQLExpress2005 DB.

When installing, the SQLServerSelectLoginDlg automagically appears. All settings are correct, clicking on next does the requested job.

I do not want to show this dialog to the end user. Is there any way to hide/disable/avoid this popup?

Thanks for any help.
Labels (1)
0 Kudos
(4) Replies
hidenori
Level 17

In the InstallScript view, select the Before Move Data | OnSQLLogin event from the dropdown boxes located above the InstallScript editor, and then comment out "nResult = SQLServerSelectLogin2( szConnection, szServer, szUser, szPassword, bWinLogin, szDB, FALSE, TRUE );"
0 Kudos
tcom36
Level 7

Thank you, finally I did not comment it out, but added some conditions to have it displayed only in case of problems getting connected.
0 Kudos
trutac
Level 3

is there any chance that you could post the command that you used to do this?

It would be really usefull for a project i am working on.

Cheers
0 Kudos
tcom36
Level 7

Well, to hide the SQLServerSelectLoginDlg, I did the following in the OnSQLLogin method:

1. declare an additional member BOOL bErrorConnecting

2. inside the method OnSQLLogin, I initialize the bErrorConnecting to false before the while (nResult = ISERR_SUCCESS).

3. inside the while loop, find the line:
nResult = SQLServerSelectLogin2(szConnection, szServer,...)
and replace it with:

if (bErrorConnecting = TRUE) then
nResult = SQLServerSelectLogin2(szConnection, szServer,...) (same line as above)
else
nResult = NEXT;
endif;

In that way, I "simulate" the user pressing on NEXT on the dialog, but should the connection fail, it will display the requester for the second attempt.

4. A bit below is a line like
if ( sTemp != "0") then
...
else
This is the code which is called in case of failure to connecting to the db. all you need is to set bErrorConnecting to TRUE inside this if statement in order to display the connection dialog if the first connection attempt fails.

Hope it helps.
0 Kudos