I have a project with that can have multiple databases on different servers. The user passes this information through a dialog screen. I am able to test the first connection without a problem, but the susequent connections are not tested. It appears that the SqlConnectionOK needs to be reset to 0 before addtional connections are tested. Please let me know if this is the problem, and how I would go about reseting it.
It appears that the SqlConnectionOK needs to be reset to 0 before addtional connections are tested. Please let me know if this is the problem, and how I would go about reseting it.
Yes, this is the problem. The SqlConnectionOK property needs to be reseted before testing another connection. For this you can use a SetProperty Init control event for the dialog which retrieves the connection information.
I have reset SqlConnectionOK to 0, but it appears that the SQL Connection test only works with the SQLConnectionDlg, and not with dialog created to duplicate it. When the installation is run with the log, the following entry does NOT get added expect when the standard SQLConnectionDlg is used:
PROPERTY CHANGE: Adding SqlConnectionOK property. Its value is '0'.
How can the TestODBCConnection be used with a user created dialog?
Ok. I have found that if I run the standard SQLConnectionDlg first the SqlConnectionOK property is added. However, no matter what values are input into the user defined Sql connection dilaog it passes the SqlConnectionOK test. Below is an extract from the log:
//----------------------- This is correct test failure when the password is incorrect using the standard SQLConnectionDlg dialog -------------------------
MSI (c) (BC:DC) [18:04:30:771]: PROPERTY CHANGE: Adding SqlConnectionString property. Its value is 'Driver={SQL Native Client};Server=Al-Pad;Port=;Uid=RASUser;Pwd=wrongpassword;'.
MSI (c) (BC:DC) [18:04:30:836]: Doing action: TestODBCConnection
Action 18:04:30: TestODBCConnection.
Action start 18:04:30: TestODBCConnection.
MSI (c) (BC:D4) [18:04:30:920]: Invoking remote custom action. DLL: C:\Users\Al\AppData\Local\Temp\MSI63B5.tmp, Entrypoint: TestSqlConnection
MSI (c) (BC!A8) [18:04:30:985]: PROPERTY CHANGE: Adding SqlConnectionOK property. Its value is '0'.
Action ended 18:04:32: TestODBCConnection. Return value 1.
//----------------------- This is an incorrect test pass when the password is wrong using a dialog created by copying the controls from SQLConnectionDlg -------
MSI (c) (BC:DC) [18:05:25:770]: PROPERTY CHANGE: Adding SqlConnectionString1 property. Its value is 'Driver={SQL Native Client};Server=Al-Pad;Port=;Uid=RASUser;Pwd=wrongpassword;'.
MSI (c) (BC:DC) [18:05:25:846]: Doing action: TestODBCConnection
Action 18:05:25: TestODBCConnection.
Action start 18:05:25: TestODBCConnection.
MSI (c) (BC:08) [18:05:25:920]: Invoking remote custom action. DLL: C:\Users\Al\AppData\Local\Temp\MSI3A85.tmp, Entrypoint: TestSqlConnection
MSI (c) (BC!C8) [18:05:25:962]: PROPERTY CHANGE: Modifying SqlConnectionOK property. Its current value is '1'. Its new value: '0'.
MSI (c) (BC!C8) [18:05:26:547]: PROPERTY CHANGE: Modifying SqlConnectionOK property. Its current value is '0'. Its new value: '1'.
Action ended 18:05:26: TestODBCConnection. Return value 1.
//-------------------------------------------------------------------------
Note that SqlConnectionOK propery value gets set to '0', but then it is reset to '1' even when the test connection string should cause a failure. I am resetting SqlConnectionOK to 0 during the initialization of the dialog.
//-------------------------------------------------------------------------
MSI (c) (BC:DC) [18:05:10:659]: PROPERTY CHANGE: Adding ResetSQL property. Its value is 'SqlConnectionOK="0"'.
//-------------------------------------------------------------------------
I'm not sure why you are encountering this behavior. Can you please send us the AIP you are using to support at advancedinstaller dot com so we can investigate it?
Please note that the "TestODBCConnection" predefined custom action uses only the "SqlConnectionString" property. Therefore, it doesn't matter if you create a property named "SqlConnectionString1", the custom action will always use "SqlConnectionString".
In this case here is what happens:
- in the first dialog you use a correct string in order to get to the second dialog
- the second dialog uses the same string as the first one, therefore the installation continues
The solution is to use the same property for all dialogs: "SqlConnectionString"
FOLLOW US
Get the latest news in Application Packaging