PDA

View Full Version : SQL Server Connections



TIM@COMMERCIALW
06-11-2004, 12:16 PM
Hello All,

I have an InstallScript MSI project which uses the SQL Servers view.

I have two SQL Connections defined with scripts underneath each.


Connection A create a new database and adds tables to the db.
Connection B inserts row data to an existing table for an existing db.


The problem that I am having is when I only select the feature that is linked to the Connection B. The Connection B scripts execute but the database for Connection A is created. It appears that even though I did not select the feature that would run Connection A scripts the db is still created. The scripts for Connection A did not run though.

When I select Connection A feature, Connection B scripts are not run as I would expect it would.


I also saw a posting that when the SQL runtine executes it will create the database if it does not exist.

This gave me a problem at first because the first script for Connection A had a create database statement which I had to remove.

Can anyone help with a resolution so that the database for Connection A is not created when the feature is not selected?

I also tried adding condition statements to check if the feature was selected but that did not help.

ie. &ConnectionAFeature=3 Or &ConnectionBFeature=3

Regards,

Tim

hidenori
06-11-2004, 01:57 PM
Tim,

Actually, we create a database when testing a connection on the SQLLogin dialog. By default, we validate all the connections in your setup regardless the features are selected or not. You can override this behavior using the IS_SQLSERVER_CONNECTIONS_TO_VALIDATE property by specifying the connection names in the SQLConnection table you want to validate. Multiple connections can be specified by separating semi-colons.

In your case, you may want to set the connection names to the property value depending on the features selection before the Next button on the SQLogin dialog is clicked.

Hope this helps.
Hidenori Yamanishi
InstallShield Software Corp

TIM@COMMERCIALW
06-11-2004, 03:48 PM
How do you do this for an InstallScript MSI project.? Your solution applies only for BASIC MSI projects.

Regards,

Tim

PaulCronk
05-09-2005, 06:12 PM
You do not want to set the connection names to the property, but instead you want to set the property IS_SQLSERVER_CONNECTIONS_TO_VALIDATE to the Sql Connection Name that should be validated.

If for example you have a Connection named Master and a Connection named Test, you would set IS_SQLSERVER_CONNECTIONS_TO_VALIDATE to Master for the SQLLogin dialog that is associated with the SQL Connection Name Master.

The property must be set prior to the event DoAction ISSQLValidate. Doing this will cause ISSQLValidate to validate the connection named Master only.


Tim,

Actually, we create a database when testing a connection on the SQLLogin dialog. By default, we validate all the connections in your setup regardless the features are selected or not. You can override this behavior using the IS_SQLSERVER_CONNECTIONS_TO_VALIDATE property by specifying the connection names in the SQLConnection table you want to validate. Multiple connections can be specified by separating semi-colons.

In your case, you may want to set the connection names to the property value depending on the features selection before the Next button on the SQLogin dialog is clicked.

Hope this helps.
Hidenori Yamanishi
InstallShield Software Corp