SQLRTGetComponentScriptError

InstallShield 2016 » InstallScript Language Reference

Project • This information applies to InstallScript projects.

The SQLRTGetComponentScriptError2 function supersedes the SQLRTGetComponentScriptError function.

The SQLRTGetComponentScriptError function retrieves the last error while executing a SQL script that is associated with the component.

Note • The SQLRTGetComponentScriptError function uses SQLRT.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

SQLRTGetComponentScriptError( szComponent, szMessage, nvErrorType, nvErrorLine );

Parameters

SQLRTGetComponentScriptError Parameters

Parameter

Description

szComponent

Specifies the name of the component that is associated with the script.

szMessage

Specifies the error message that the database server returned.

nvErrorType

Specifies the type of error. Valid types are:

SQL_ERROR_SCRIPT_UNABLE_OPEN_FILE—Failed to open the script file.
SQL_ERROR_SCRIPT_CONNECTION_NOT_OPEN—The specified connection is not opened.
SQL_ERROR_GET_SCHEMA_VERSION—Error while attempting to get the schema version from the target database.
SQL_ERROR_SET_SCHEMA_VERSION—Error while attempting to set the schema version to the target database.
SQL_ERROR_SCRIPT_COMMAND_ERROR—Failed to execute a SQL batch.

nvErrorLine

Specifies the line number of the error.

Return Values

SQLRTGetComponentScriptError Return Values

Return Value

Description

TRUE

One or more errors occurred.

FALSE

No errors occurred.

See Also