GetLastSQLState()


" "

BSTR GetLastSQLState()

Description

This function returns the SQL state for the most recent error. If you call GetLastSQLState() after a function that executed successfully, then this API returns information about the last error that occurred during a prior function call. To avoid confusion, always call GetLastSQLState() immediately after calling a function that returned an error.

Return Value

A string containing the SQL code for the most recent error. If no errors have occurred since you created the QMF for Windows API object, or the most recent error was not an SQL error, NULL is returned.

Related Tasks

GetLastErrorString()
GetLastErrorType()
GetLastSQLCode()
GetLastSQLError()