cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Brandon_Lowe
Level 6

Using SQL Scripts with BasicMSI install

Hello all,
here is my dumb question of the day. I have been using installshield for years but always doing installscript installations. I have now been working on a large BasicMSI install. Mys current problem is this.
In installscript we had some SQL Scripts in the SQLscripts panel and I would call them using SQLRTConnect.
Now with the Basic MSI install I cannot do this. I tried to create an Installscript custom action that used it but that would not compile.
So how do I call a SQL script during the install when I want it to run and how do I test it for success or failure?
I have a few scripts but one for example needs to run when the user clicks next on the SQLLogin dialog.

Thank you
Brandon
Labels (1)
0 Kudos
(5) Replies
hidenori
Level 17

The SQLRTConnect InstallScript function is not available in Basic MSI projects. When you add a SQL connection in the SQL Scripts view, InstallShield automatically adds the SQLLogin dialog and the underlying custom actions for the SQL support to your project. To run a SQL script when the end user clicks the Next button on the SQLLogin dialog, you need to select the "Run Script during Login" check box in the Runtime tab in the SQL Scripts view for the SQL script.

Hope that helps.
0 Kudos
Brandon_Lowe
Level 6

Well that helps somewhat. How about this question.
After the login dialog the install does validate the login info but if it is bad it displays a login validation failure message but instead of going back to the sql login dialog it goes forward to the next dialog. How can I check the results and go back to the login dialog?
0 Kudos
hidenori
Level 17

Make sure that you have the condition for your NewDialog event of the Next push button control on the SQLLogin dialog as the attached screenshot. The IS_SQLSERVER_STATUS Windows Installer property is set to 0 by the ISSQLServerValidate action when a login validation is successful.
0 Kudos
Brandon_Lowe
Level 6

Thank you for the help.
Is there a way to check if the user entered on the login screen is a member of the sql admin group?
I know how to do it with the sqlscript and I now now I can run that sql script right after the login dialog but how do I get the info back to the installer if the user is not a member of the admin group and then display a message and go back to the login dialog?
Can I change a property valuse from a SQL script?
0 Kudos
hidenori
Level 17

Unfortunately, InstallShield does not provide the ability that allows you get SQL query information back to the installer at this time. I wonder if you could write a SQL script that raises an error if the specified user is not a member of the admin group.
0 Kudos