This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- SQLServerSelectLoginDlg
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 06, 2007
07:33 PM
SQLServerSelectLoginDlg
This new login dialog has an edit database catalog box which allows users to specify database catalogs. Does this work only for the available catalogs on a server, which can be selected by clicking on the browse button, or user can type in his own (variable) catalog name?
Anybody knows how to do this?
Anybody knows how to do this?
(10) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 07, 2007
09:55 AM
You need to select the "Create Catalog if Absent" option in order for end users to be able to specify a database name that does not exist on the target server. The option will create the specified database after the login credential is verified and before connecting to the database.
Hope that helps.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 07, 2007
01:16 PM
I check the Create Catalog If Absent and then I enter password and database name. The database name is recorded and when I click on the Browse button it is there. But then when the SQL script is run to restore that database I get syntax errors.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 07, 2007
01:43 PM
If you have your own SQL script to create a database, you need to uncheck the "Create Catalog If Absent" option. Also, you need to run that script during logging in by selecting the "Run Script During Login" option in the Script | Runtime tab. In addition, the following steps illustrate how you pass the catalog name entered in the SQLServerSelectLoginDlg dialog to your SQL script:
The database must exist before InstallShield attempts to establish a connection to it. The "Run Script During Login" option allows you to run a script after the login credential is verified, and before connecting to a specified database.
Regards.
1. Use a placeholder for the RESTORE DATABASE statement in your SQL script.
RESTORE DATABASE %MyDB%
2. Add the following line immediate after the SQLServerSelectLogin2 call in the OnSQLServerInitialize() event:
TextSubSetValue("", szDB, TRUE);
3. Add the following text replacement entry to your SQL script in the SQL Scripts veiw:
Find What: %MyDB%
Replace With:
Replace With:
4. Build your setup
The database must exist before InstallShield attempts to establish a connection to it. The "Run Script During Login" option allows you to run a script after the login credential is verified, and before connecting to a specified database.
Regards.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 07, 2007
07:13 PM
No, it does not work. Maybe because I converted the project from InstallShield 11 to InstallShield 2008. And now some functionality is lost. I tried to import the SQLServerSelectLoginDlg from version 11 (where I have added edit box for database name so users can type in whatever they want). This worked perfectly in v. 11. But now when I converted it to v. 2008 I get SQL errrors when executing the scripts.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 07, 2007
11:34 PM
What does the SQL scripting error say? Does it work if you create a new InstallScript project in IS 2008?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 10, 2007
11:31 AM
I will try to create a new project in IS 2008.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 10, 2007
04:28 PM
I created a new IS 2008 project and I get SQL errors: error on line 6 in this script:
RESTORE DATABASE FileHold4
FROM DISK = 'FileHold1'
WITH REPLACE,
MOVE 'DBs' TO 'FileHold2',
MOVE 'Dbs_Log' TO 'FileHold3'
GO
This works in IS 11. Clearly I am missing something, because the project when converted to IS 2008 from IS 11 looses functionality.
RESTORE DATABASE FileHold4
FROM DISK = 'FileHold1'
WITH REPLACE,
MOVE 'DBs' TO 'FileHold2',
MOVE 'Dbs_Log' TO 'FileHold3'
GO
This works in IS 11. Clearly I am missing something, because the project when converted to IS 2008 from IS 11 looses functionality.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 10, 2007
04:31 PM
Could you email me your IS 11 and 2008 projects at hidenoriy@macrovision.com? I will look into it.
Thank you.
Thank you.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 10, 2007
05:04 PM
The problem is that it is too late to set your database informaton to the text substitutions. You need to move the following code to the OnSQLServerInitialize() event before the SQLRTConnect() function call:
if (bEmpty) then
szBackup = SUPPORTDIR ^ "V12SE_EMPTY.BAK";
else
szBackup = SUPPORTDIR ^ "V12SE_DEMO.BAK";
endif;
szMDF = svDir ^ svDBText + ".MDF";
szLDF = svDir ^ svDBText + ".LDF";
TextSubSetValue( "", szBackup, TRUE );
TextSubSetValue( "", szMDF, TRUE );
TextSubSetValue( "", szLDF, TRUE );
TextSubSetValue( "", svDBText, TRUE);
Also, you need to change svDBText to szDB, and you need to eliminate the svDBText global string variable, or the sqlserverlselectlogindlg.rul file from your project. If it still does not work, please debug into your code to see if the text substitutions are correctly set as you expect.
Hope that helps.
if (bEmpty) then
szBackup = SUPPORTDIR ^ "V12SE_EMPTY.BAK";
else
szBackup = SUPPORTDIR ^ "V12SE_DEMO.BAK";
endif;
szMDF = svDir ^ svDBText + ".MDF";
szLDF = svDir ^ svDBText + ".LDF";
TextSubSetValue( "
TextSubSetValue( "
TextSubSetValue( "
TextSubSetValue( "
Also, you need to change svDBText to szDB, and you need to eliminate the svDBText global string variable, or the sqlserverlselectlogindlg.rul file from your project. If it still does not work, please debug into your code to see if the text substitutions are correctly set as you expect.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 11, 2007
12:56 PM
I worked with milan10 offline and we have solved the issue. The problem was that IS 2008 is designed to connect to the database specified in the SQLServerSelectLoginDlg dialog when clicking the Next button. IS 11 is designed to connect to the database specified in the SQL Scripts view which is blank in his case. He needed to change the code below in the OnSQLServerInitialize() event in order to get it working with IS 2008:
From:
To:
From:
SQLRTPutConnectionInfo2( szConnection, szServer, szDB, szUser, szPassword );
To:
SQLRTPutConnectionInfo2( szConnection, szServer, “”, szUser, szPassword );
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)