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
- :
- SQLServerSelectLogin2 database variable
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 04, 2007
06:41 PM
SQLServerSelectLogin2 database variable
Hello,
I am working with InstallScript project (2008 version of InstallShield), where I need to let user type in a variable database name. In this new version there is a new SQLServerSelectLogin2 functon with bShowDBcatalog as one of the parameters where user types in or selects available database by clicking on the Browse button.
I am running SQL script to restore a database which would create that database on the server. But when I type in a database name I get error that it is not available on the server.
Can anyone help?
Thanks,
Milan
I am working with InstallScript project (2008 version of InstallShield), where I need to let user type in a variable database name. In this new version there is a new SQLServerSelectLogin2 functon with bShowDBcatalog as one of the parameters where user types in or selects available database by clicking on the Browse button.
I am running SQL script to restore a database which would create that database on the server. But when I type in a database name I get error that it is not available on the server.
Can anyone help?
Thanks,
Milan
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 05, 2007
10:12 AM
You need to run the script that will create the desired database during logging in by selecting the Run Script During Login option in the Script | Runtime tab. The database must present before InstallShield connects to it. The option allows you to run a script after the login credentials are verified, and before connecting to a specified database. Please refer to http://helpnet.installshield.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield11helplib/SQL-Script_Runtime.htm for more details about the option.
Hope that helps.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 05, 2007
11:57 AM
No it did not help. Still when I type in the database name in the edit database field (catalog name), I can only type in a database that is available on the server. It would not let me create my own database.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 05, 2007
12:04 PM
Would it be possible for you to email me your project and SQL scripts at hidenoriy@macrovision.com? I am wondering how you pass the specified catalog name to your script that restores a database.
Thank you.
Thank you.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 05, 2007
12:32 PM
I sent it!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 05, 2007
12:54 PM
Thank you for providing your scripts. You do not seem to specify the catalog name entered in the SQLLogin dialog to use in your RESTORE DATABASE statement. Please follow the steps below to resolve the issue.
You also need to replace such placeholders as FileHold1, FileHold2 etc. used in your SQL script with real values.
1. Add the following line immediate after the SQLServerSelectLogin2 call in the OnSQLServerInitialize() event:
TextSubSetValue("", szDB, TRUE);
2. Add the following text replacement entry to your SQL script in the SQL Scripts veiw:
Find What: FileHold4
Replace With:
Replace With:
3. Build your setup
You also need to replace such placeholders as FileHold1, FileHold2 etc. used in your SQL script with real values.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 05, 2007
01:16 PM
I already set the plaeholders and the FileHold1 and FileHold2 are real values...they are in the setup.rul:
// Setting SQL script variables
if (bEmpty) then
szBackup = SUPPORTDIR ^ "V5_EMPTY.BAK";
else
szBackup = SUPPORTDIR ^ "V5_DEMO.BAK";
endif;
szMDF = svDir ^ svDB + ".MDF";
szLDF = svDir ^ svDB + ".LDF";
TextSubSetValue( "", szBackup, TRUE );
TextSubSetValue( "", szMDF, TRUE );
TextSubSetValue( "", szLDF, TRUE );
TextSubSetValue( "", svDB, TRUE);
// Setting SQL script variables
if (bEmpty) then
szBackup = SUPPORTDIR ^ "V5_EMPTY.BAK";
else
szBackup = SUPPORTDIR ^ "V5_DEMO.BAK";
endif;
szMDF = svDir ^ svDB + ".MDF";
szLDF = svDir ^ svDB + ".LDF";
TextSubSetValue( "
TextSubSetValue( "
TextSubSetValue( "
TextSubSetValue( "
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 05, 2007
01:31 PM
I am sorry that I missed it. It seems too late that you set the information to the text substitutes. That must be done between the SQLServerSelectLogin2() and SQLRTConnect() function calls in the OnSQLServerInitialize() event. Also, I would suggest you to debug into your InstallScript code and see if the catalog name is set to the svDB global variable as expected.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)