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 ignored
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Oct 14, 2011
05:37 AM
SQL error ignored
Hi everyone,
I've created a Basic MSI for one of our applications. As part of the installation, the user need to browse for an MS SQL server and select a database. This works, and I can then create a configfile to setup the chosen database.
We would, however, like to check whether the database appears to be "ours", so I've created a simple SQL Script to check:
use DATABASE
select * from dbo.SSYS
The script is set to run during login, and error handling is set to "On error, abort installation". The latter is not exactly what's happening - when it works, it simply prevents the user from going any further, it does not abort the installation.
But "works" is a rather inappropriate description: In the above script, I've set a Text Replacement to replace the word DATABASE with the name of the database chosen by the user. I've also created an ordinary script to show the value in a messagebox, and the [IS_SQLSERVER_DATABASE] does hold the correct value.
Nevertheless: When running the above script, I never get any errors, no matter whether the dbo.SSYS table exist or not. If I remove the "use DATABASE" line, the script always fails (I would expect that, of course).
But why doesn't the script fail when the table doesn't exist?
I would like to show the user a proper error description, of course, but it seems that most SQL routines are available for use with InstallScript only - not Basic MSI packages. Is it at all possible to have intelligent SQL handling with Basic MSI?
Unfortunately, using InstallScript isn't an option as this app will ultimately have to pass Microsoft certification.
Regards,
Lars
I've created a Basic MSI for one of our applications. As part of the installation, the user need to browse for an MS SQL server and select a database. This works, and I can then create a configfile to setup the chosen database.
We would, however, like to check whether the database appears to be "ours", so I've created a simple SQL Script to check:
use DATABASE
select * from dbo.SSYS
The script is set to run during login, and error handling is set to "On error, abort installation". The latter is not exactly what's happening - when it works, it simply prevents the user from going any further, it does not abort the installation.
But "works" is a rather inappropriate description: In the above script, I've set a Text Replacement to replace the word DATABASE with the name of the database chosen by the user. I've also created an ordinary script to show the value in a messagebox, and the [IS_SQLSERVER_DATABASE] does hold the correct value.
Nevertheless: When running the above script, I never get any errors, no matter whether the dbo.SSYS table exist or not. If I remove the "use DATABASE" line, the script always fails (I would expect that, of course).
But why doesn't the script fail when the table doesn't exist?
I would like to show the user a proper error description, of course, but it seems that most SQL routines are available for use with InstallScript only - not Basic MSI packages. Is it at all possible to have intelligent SQL handling with Basic MSI?
Unfortunately, using InstallScript isn't an option as this app will ultimately have to pass Microsoft certification.
Regards,
Lars
(3) Replies
‎Oct 26, 2011
02:14 PM
You can manage the behavior via the control events for the Next push button control on the SQLLogin dialog as follows:
[LIST=1]
Open your project in InstallShield.
Navigate to the Dialogs view under the User Interface section.
Select the Behavior node under the SQLLogin dialog.
Select the Next push button control in the Dialog Behavior pane.
Add the following entry in the Events pane:
Event: EndDialog
Argument: Exit
Condition: IS_SQLSERVER_STATUS<>0 AND IS_SQLSERVER_STATUS_ERROR><"27506"
Rebuild your release.
Hope that helps.
[LIST=1]
Event: EndDialog
Argument: Exit
Condition: IS_SQLSERVER_STATUS<>0 AND IS_SQLSERVER_STATUS_ERROR><"27506"
Hope that helps.
‎Oct 28, 2011
06:26 AM
Hi hidenori,
I've tried you recommendations - but unfortunately to no avail.
I created a dialog to show the value of the two variables in question; this dialog pops up when pressing "Next" in the SQLLogin dialog.
The value of IS_SQLSERVER_STATUS is always 0 and the value of IS_SQLSERVER_STATUS_ERROR is always blank - no matter the result (or expected result) of the SQL script. :confused:
Regards,
Lars
I've tried you recommendations - but unfortunately to no avail.
I created a dialog to show the value of the two variables in question; this dialog pops up when pressing "Next" in the SQLLogin dialog.
The value of IS_SQLSERVER_STATUS is always 0 and the value of IS_SQLSERVER_STATUS_ERROR is always blank - no matter the result (or expected result) of the SQL script. :confused:
Regards,
Lars