SQL_GetError()

Examples


The SQL_GetError() function returns information about the last error that occurred for the current results set of the specified pass-through SQL connection.

Syntax

SQL_GetError(SQL_connection, internal_error_number, SQL_error_number, SQL_error_string, ODBC_error_string)

Parameters

SQL_connection – A long integer specifying the pass-through SQL connection for which error information will be returned.

internal_error_number A long integer containing the internal error code corresponding to the error that occurred. The following table lists the common error codes:

[spacer]

Value

Description

0

No error

41

Can’t find specified column

56

Can’t find specified table

58

Syntax error in SQL statement


SQL_error_number A long integer containing the native SQL Server™ error code for the error that occurred.

SQL_error_string A string containing the text for the native SQL Server error that occurred.

ODBC_error_string A string containing the ODBC error that occurred.

Return value

A long integer indicating whether error information was available and successfully retrieved. If the value is 0, error information was available and successfully retrieved.


Documentation Feedback