SQL Functions

InstallShield 2024 » InstallScript Language Reference

The SQL functions enable you to perform tasks such as connect to a catalog, create SQL-related dialogs, and obtain SQL run-time errors.

Tip:For information on SQL support and SQL-related InstallScript functions, see Using the SQL Run-Time Functions in InstallScript and InstallScript MSI Projects.

SQL Functions

Function

Project Type

Description

SQLBrowse

InstallScript, InstallScript MSI

Creates a dialog that enables the end user to bring up a list of all SQL Servers available on the network.

SQLBrowse2 supersedes this function.

SQLBrowse2

InstallScript, InstallScript MSI

Creates a dialog that lets an end user display a list of all database servers that are available on the network for the database technologies specified for a connection.

SQLDatabaseBrowse

InstallScript, InstallScript MSI

Creates a dialog that lets the end user display a list of all database catalogs available on the specified database server. This function calls SQLRTGetDatabases, which uses SQLRT.dll for InstallScript projects and ISSQLSRV.dll for InstallScript MSI projects.

SQLRTComponentInstall

InstallScript

Executes the SQL script that is associated with the specified component if the script is scheduled to run during installation.

SQLRTComponentUninstall

InstallScript

Executes the SQL script that is associated with the specified component if the script is scheduled to run during uninstallation.

SQLRTConnect

InstallScript

Establishes a connection using the specified credential.

SQLRTConnect2 supersedes this function.

SQLRTConnect2

InstallScript

Establishes a connection. This function must be called before file transfer if the connection is to be used to run scripts during installation. SQLRTConnect2 returns the database server name when it fails to establish the connection. It uses SQLRT.dll so it can be called only after SQLRTInitialize2 has already been called.

SQLRTConnectDB

InstallScript

Establishes a connection to a specific catalog.

SQLRTDoRollbackAll

InstallScript

Executes all of SQL scripts scheduled to run during rollback.

SQLRTGetBatchList

InstallScript

Returns the list of components that are associated with SQL scripts that need to be run when batch mode is enabled.

For details about batch mode, see Specifying the Order for Running Multiple SQL Scripts That Are Associated with a Connection.

SQLRTGetBatchMode

InstallScript

Returns whether batch mode is enabled or disabled.

SQLRTGetBrowseOption

InstallScript

Returns the current value of the browse option for the SQL Server browse combo box and list box controls, which can display local servers, remote servers, server aliases, or a combination of these types.

SQLRTGetComponentScriptError

InstallScript

Retrieves the last error while executing a SQL script that is associated with the component.

SQLRTGetComponentScriptError2 supersedes this function.

SQLRTGetComponentScriptError2

InstallScript

Retrieves the last error while executing a SQL script that is associated with the component.

This function takes several parameters (szScriptName, szTechnology, szServer, and szDB) that the SQLRTGetComponentScriptError function does not.

SQLRTGetConnectionAuthentication

InstallScript, InstallScript MSI

Gets the default SQL Server connection authentication type.

SQLRTGetConnectionInfo

InstallScript, InstallScript MSI

Retrieves strings containing the connection information (the default server, database, default user name, and default password).

SQLRTGetConnections

InstallScript, InstallScript MSI

Retrieves a string list of connections that are present in the settings file.

SQLRTGetDatabases

InstallScript, InstallScript MSI

Returns a list of database catalogs that are available on the specified database server.

SQLRTGetErrorMessage

InstallScript

Returns the descriptive message of the last error encountered by the SQL run time when a connection is being opened.

SQLRTGetLastError

InstallScript

Returns the text of the last error encountered by the SQL run time.

SQLRTGetLastError2 supersedes this function.

SQLRTGetLastError2

InstallScript

Returns detailed information about the last error encountered by the SQL run time and loads the proper SQL error message.

SQLRTGetScriptErrorMessage

InstallScript

Returns the descriptive message of the last error encountered by the SQL run time when a SQL script is executing.

SQLRTGetServers

InstallScript, InstallScript MSI

Returns a list of database servers on the network for all database technologies included in the installation.

SQLRTGetServers2 supersedes this function.

SQLRTGetServers2

InstallScript, InstallScript MSI

Returns a list of database servers for the database technologies that are specified for a connection. When szConnection is empty, this function behaves as SQLRTGetServers.

SQLRTInitialize

InstallScript

Loads the SQLRT.dll and initializes it using the settings file. This function must be the first function called in SQLRT.

SQLRTInitialize2 supersedes this function.

SQLRTInitialize2

InstallScript, InstallScript MSI

Loads the SQLRT.dll file for InstallScript projects and the ISSQLSRV.dll file for InstallScript MSI projects, and it uses the settings file to initialize the .dll file.

This function must be the first function called in SQLRT or ISSQLSRV.

SQLRTPutConnectionAuthentication

InstallScript, InstallScript MSI

Sets the default SQL Server connection authentication type.

SQLRTPutConnectionInfo

InstallScript, InstallScript MSI

Sets the connection information (the default server, default user name, and default password) so that it is available in the future. This is useful in situations when you need to recall what a user previously entered, like use of the Back button.

SQLRTPutConnectionInfo2 supersedes this function.

SQLRTPutConnectionInfo2

InstallScript, InstallScript MSI

Sets the connection information (the default server, default database catalog, default user name, and default password) so that it is available in the future. This is useful in situations when you need to recall what an end user previously entered, like use of the Back button.

SQLRTServerValidate

InstallScript MSI

Tests connections specified in the installation.

SQLRTSetBrowseOption

InstallScript

Specifies whether the SQL Server browse combo box and list box controls should show local servers, remote servers, server aliases, or a combination of these types.

SQLRTTestConnection

InstallScript MSI

Tests all of the connections specified in the installation using the specified credential.

SQLRTTestConnection2 supersedes this function.

SQLRTTestConnection2

InstallScript MSI

Establishes a connection.

SQLServerLogin

InstallScript, InstallScript MSI

Creates a dialog that is used by the script to specify SQL login credentials. These credentials include the login ID and password.

SQLServerSelect

InstallScript, InstallScript MSI

Creates a dialog to specify a server to target.

SQLServerSelectLogin

InstallScript, InstallScript MSI

Creates a login dialog that enables the targeted end user to specify which SQL Server should to be used for the current connection, as well as which login credential should be used. The dialog displays a combo box that contains a list of SQL Servers accessed through DSNs. The end user can type a server name in the combo box or click the Browse button next to the combo box; clicking this button displays a list of all SQL Servers that are available on the network.

SQLServerSelectLogin2 supersedes this function.

SQLServerSelectLogin2

InstallScript, InstallScript MSI

Creates a login dialog that is used by the default script. It lets the targeted end user specify which SQL Server should be used for the current connection, as well as which login credential should be used. The dialog displays a combo box that contains a list of SQL Servers accessed through DSNs. The end user can type a server name in the combo box or click the Browse button next to the Server Name combo box; clicking this button displays a list of all SQL Servers that are available on the network.

This function also optionally shows the connection name that is associated with the connection information. In addition, it optionally enables end users to specify which database catalog should be used for the current connection.

SQLServerSelectLoginEx

InstallScript, InstallScript MSI

Creates a login dialog that is used by the default script. It lets the targeted end user specify which SQL Server should be used for the current connection, as well as which login credential should be used. The dialog displays a combo box that contains a list of SQL Servers accessed through DSNs. The end user can type a server name in the combo box or click the Browse button next to the Server Name combo box; clicking this button displays a list of all SQL Servers that are available on the network.

This function also shows the connection name that is associated with the connection information.

SQLServerSelectLogin2 supersedes this function.