How to test SQL connection parameters?AnswerWhen using the SQL Scripts functionality and you require to prompt the user for ODBC connection parameters (for an ODBC driver), you might want to test if the connection works before proceeding. This will prevent an installation rollback due to incorrect connection parameters when executing the SQL scripts.
Select the button from this dialog and go to the Published Events tab and add a new "SetProperty" Published Event with the following parameters (E.g. for MS SQL Server):
Connection TimeoutOptionally, you can specify a connection timeout (in seconds) for this test. The default is 60 seconds. The timeout can be specified through the Windows Installer property SqlConnectionTimeout. You can set this property statically (from Install Parameters), or dynamically (from the installer UI - associated with an Edit Control, or with a SetProperty Control Event).
Return to Events Editor tab (Dialog Editor view) and add a new published event on the same button:
Edit the existing NewDialog published event on this button and set its condition to: SqlConnectionOK = "1". This will prevent the installation wizard to continue if the connection parameters are incorrect.
| |
| Privacy Policy | Windows Installer | Search Engine Ranking | Link Analyzer | ||
| © 2002 - 2008 Caphyon Ltd. Trademarks belong to their respective owners. All rights reserved. | ||