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
- :
- Re: SQL error when run during Modify
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
‎Jan 15, 2009
03:18 PM
SQL error when run during Modify
In my installation I have 2 SQL scripts. These 2 scripts run on different SQL instances, usually different machines. If both scripts are run during the first install, no problem.
One script runs "On" installation, I don't seem to have any problems with this script. The other script may or may not run during the first install. You can run the install in modify mode and select the feature associated with this script which is when I have the problem. I get the following error:
Error 27502.Could not connect to Microsoft SQL Server ".[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. (17)
In OnMaintUIBefore I call the OnSQLLogin function and fill in the same data that I use if this function is displayed during OnFirstUIBefore.
This looks to me like it is not using the connection data from the OnSQLLogin function. (InstallScript MSI project)
Any ideas??
One script runs "On" installation, I don't seem to have any problems with this script. The other script may or may not run during the first install. You can run the install in modify mode and select the feature associated with this script which is when I have the problem. I get the following error:
Error 27502.Could not connect to Microsoft SQL Server ".[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. (17)
In OnMaintUIBefore I call the OnSQLLogin function and fill in the same data that I use if this function is displayed during OnFirstUIBefore.
This looks to me like it is not using the connection data from the OnSQLLogin function. (InstallScript MSI project)
Any ideas??
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 19, 2009
10:33 AM
I think I have found half my problem.
I put a messagebox in a custom action to display all the SQL connection info before it runs the script but after the UI.
Since the database can be on any machine the user selects the server. This selection is not being stored.
I used:
SQLRTGetConnectionInfo( szConnection, szServer, szDB, szUser, szPassword );
MessageBox ("Connection: " + szConnection + "; Server: " + szServer + "; DB: " + szDB + "; User: " + szUser + "; PW: " + szPassword, INFORMATION );
szServer was blank. Everything else was there.
What do I need to do to store the server?
I put a messagebox in a custom action to display all the SQL connection info before it runs the script but after the UI.
Since the database can be on any machine the user selects the server. This selection is not being stored.
I used:
SQLRTGetConnectionInfo( szConnection, szServer, szDB, szUser, szPassword );
MessageBox ("Connection: " + szConnection + "; Server: " + szServer + "; DB: " + szDB + "; User: " + szUser + "; PW: " + szPassword, INFORMATION );
szServer was blank. Everything else was there.
What do I need to do to store the server?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 20, 2009
02:49 PM
OK Acresso Software, I can't find any documentation on how to store the db server. Upon further testing it looks like the function calls inside OnSQLLogin work for the first time install but they don't work if you call the same OnSQLLogin during a maintenance install.
Is this a bug or am I not looking in the right place for documentation?
Is this a bug or am I not looking in the right place for documentation?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2009
09:51 AM
InstallShield stores the SQL login information in the registry during the initial installation, and reuses them during the maintenance and uninstallation. In order to turn off this behavior, you need to specify the IS_SQLSERVER_DO_NOT_USE_REG Windows Installer property. Please add the following code before the OnSQLLogin() call in the OnMaintUIBefore and see if it solves your issue:
MsiSetProperty(ISMSI_HANDLE, "IS_SQLSERVER_DO_NOT_USE_REG", "1");
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2009
01:49 PM
Looks like that worked.
Thanks.
Thanks.