InstallShield 2016 » InstallScript Language Reference
Project • This information applies to InstallScript MSI projects.
The SQLRTTestConnection2 function establishes a connection.
Note • The SQLRTTestConnection2 function uses ISSQLSRV.dll; therefore, it can be called only after SQLRTInitialize2 has already been called. To learn more, see Using the SQL Run-Time Functions in InstallScript and InstallScript MSI Projects.
Syntax
SQLRTTestConnection2( szConnection, szServer, szDB, szUserName, szPassword, bTrust );
Parameters
Parameter |
Description |
szConnection |
Specifies the SQL Server connection. |
szServer |
Specifies the SQL Server. |
svDB |
Specifies the catalog. |
szUser |
Specifies the SQL Server login information. |
szPassword |
Specifies the password associated with a user account. |
bTrust |
Specifies the initial state of the radio buttons specifying login using Windows credentials vs. SQL Server credentials. When this is TRUE, the password and login ID fields are disabled. When it is FALSE, indicating that SQL Server credentials are to be used, the password and login fields are enabled. Once the function returns, this parameter contains TRUE if the Windows credentials radio button was specified by the end user and FALSE if the SQL Server credentials radio was selected instead. |
Return Values
Return Value |
Description |
=ISERR_SUCCESS |
This function was able to establish a connection. |
SQL_ERROR_NOT_INITIALIZED |
ISSQLSRV.dll is not loaded. |
Additional Information
The result is used to set the value of the IS_SQLSERVER_STATUS property. Possible values are listed in the following table.
Return Value |
Description |
0 |
The function was able to establish one or more connections. |
1 |
The function failed to establish a connection. |
2 |
The function was able to establish a connection, but it failed to retrieve the product version from the target database server. |
3 |
The function was able to establish a connection, but the version requirement was not met. |
4 |
The function was able to establish a connection, but MSDE or the Express version was not allowed. |
5 |
The function was able to establish a connection, but it failed to retrieve the schema version from the target database catalog. |
6 |
The function was able to establish a connection, but it failed to set the schema version to the target database catalog. |
7 |
The function could not find the specified ODBC driver. |
8 |
The function was able to establish a connection to the default database catalog, but it failed to create the target database catalog (when Create Catalog If Absent check box in the SQL Scripts view is selected). |
9 |
The function was able to establish a connection to the default database catalog, but it failed to connect to the target database catalog. |
10 |
The function could not find a valid record in ISSQLDBMetaData table. |
See Also
InstallShield 2016 Help LibraryMay 2017 |
Copyright Information | Flexera Software |