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

Two SQL Connections

Hi,

In my installation, I'm giving options to user to connect & execute SQL scripts against Oracle or MSSQL database. When I select to connect to Oracle it works fine (validated & script executed), but it just did nothing when I select to connect to MSSQL database (It didn't give me any errors, even when I type server & catalog that are non-existent).

FYI, I have created two SQL connections in SQL Scripts View, the first one to Oracle, and the second one to MS SQL server.

Any idea? Thanks in advance.
Labels (1)
0 Kudos
(2) Replies
Christopher_Pai
Level 16

Typically you would have to clone the sqlllogin dialog then insert controlevents in the next button to set a property that restricts the connections to validate. This way the NEXT of dialog 1 would validate one connection and the next button of dialog 2 would validate the other connection.

This is covered in the help.
0 Kudos
pradana
Level 6

I resolved it. I followed the instructions given here: http://community.installshield.com/showthread.php?t=171543&page=2&highlight=oralce+connection but I forgot to do step 1.


By default, InstallShield verifies all of the connections specified in the SQL Scripts view, and lists available server names for all of the database technologies selected in the Advacned tab. Using the IS_SQLSERVER_CONNECTIONS_TO_VALIDATE Windows Installer property, you can only display available server names specific to a connection, and/or validate a specific connection. So you should be able to accomplish your requirements by having a separate connection for each database technology. The following steps illustrates how it can be done using one SQLLogin dialog, and a database server type selection dialog:

1. In the SQL Scripts view, add 2 connections and name them MSSQL and ORACLE.
2. Mark only the "Microsoft SQL Server" checkbox for the MSSQL connection, and the "Oracle" for the ORACLE connection in the Advanced tab.
3. In the Dialogs view, add a new dialog named "MyDbServerType".
4. Add a RadioButtonGroup control and associate with a custom Windows Installer property named MY_DB_SERVER_TYPE.
5. Add 2 RadioButton controls and set "Microsoft SQL Server" and "Oracle" as the text for each.
6. Set MSSQL to the Value property of the "Microsoft SQL Server" RadioButton, and ORACLE to the "Oralce" RadioButton.
7. Change the dialog sequence to display the MyDbServerType dialog between the CustomerInformation and SQLLogin dialog.
8. Add the following event to the Next button, the BtnSQLBrowse button, and the BtnDbBrowse button of the SQLLogin dialog and place it before the DoAction event:
[IS_SQLSERVER_CONNECTIONS_TO_VALIDATE] [MY_DB_SERVER_TYPE] 1

By checking the value of the MY_DB_SERVER_TYPE property, you should be able to know which database technology is picked for the selected server name.


So, I renamed my connections as ORACLE and MSSQL and things work. Thanks 😉
0 Kudos