SQL Test Connection (ISqlTestConnection)
Overview
The SQL Test Connection operation verifies whether a database connection can be successfully established using the provided connection string. This is useful for validating user input before executing SQL scripts or queries during installation.
This object is created under SqlDatabasesComponent and appears in the SQL Test Connection tab in Advanced Installer.
The ISqlTestConnection has the following methods and properties:

Methods
- (No methods available for ISqlTestConnection)
Properties
- Name (string) {get}{set} Gets or sets the display name of this test connection operation.
- ConnectionString (string) {get}{set} Gets or sets the ODBC connection string used to test the connection. Example: Driver={ODBC Driver 17 for SQL Server};Server=localhost;Database=master;Trusted_Connection=Yes;
- Use64bitOdbcResource (bool) {get}{set} When true, uses the 64-bit ODBC resource for testing. When false, uses 32-bit.
- LoginTimeout (uint) {get}{set} Gets or sets the login timeout in seconds before the test connection fails.
- OutputProperty (string) {get}{set} Gets or sets the installer property that will store the result of the test (success/failure).
- IsVerbose (bool) {get}{set} Enables verbose logging for this test connection operation when true.
Sample commands
# SQL Operations - SQL Test Connection
$advinst = New-Object -ComObject "AdvancedInstaller"
$project = $advinst.CreateProject($advinst.ProjectTypes.Enterprise)
# Create a Test Connection operation
$testConnection = $project.SqlDatabasesComponent.NewTestConnection("Test Connection")
# Configure connection string and behavior
$testConnection.ConnectionString = "Driver={ODBC Driver 17 for SQL Server};Server=localhost;Database=master;Trusted_Connection=Yes;"
$testConnection.Use64bitOdbcResource = $true
$testConnection.LoginTimeout = 30
$testConnection.IsVerbose = $true
# Store result in an installer property
$testConnection.OutputProperty = "TEST_CONN_RESULT"
$project.SaveAs("F:\cmdlet\output\SQL Test Connection.aip")