Help Center

CODBCBase.GetLastResultmethod

Returns the last result code.

DatabasesmethodCODBC.incdocumented

Syntax

FUNCTION GetLastResult () AS SQLRETURN

Return value

The result code returned by the last executed ODBC method.

GetDiagRec or GetDiagField returns SQLSTATE values as defined by X/Open Data Management: Structured Query Language (SQL), Version 2 (March 1995). SQLSTATE values are strings that contain five characters. The following table lists SQLSTATE values that a driver can return for GetDiagRec.

The character string value returned for an SQLSTATE consists of a two-character class value followed by a three-character subclass value. A class value of "01" indicates a warning and is accompanied by a return code of SQL_SUCCESS_WITH_INFO. Class values other than "01," except for the class "IM," indicate an error and are accompanied by a return value of SQL_ERROR. The class "IM" is specific to warnings and errors that derive from the implementation of ODBC itself. The subclass value "000" in any class indicates that there is no subclass for that SQLSTATE. The assignment of class and subclass values is defined by SQL-92.

Note Although successful execution of a function is normally indicated by a return value of SQL_SUCCESS, the SQLSTATE 00000 also indicates success.

Description

Returns the last result code.

Reference

  • Include file CODBC.inc
  • Defined in AfxNova/COdbc.inc:78
  • Documented in Databases/ODBC Classes/CODBC Class.md
  • Topic: ODBC Classes