SQLErrorClass$

Syntax

SQLErrorClass$(ErrorNum)

Remarks

Determines the ODBC SQLSTATE class and subclass of the specified error. For errors that occur in the data source, the ODBC driver maps the returned native error to the appropriate SQLSTATE. For errors that are detected by the driver or the Driver Manager, the driver or Driver Manager generates the appropriate SQLSTATE.

SQLSTATE values are specified by the X/Open and SQL Access Group SQL CAE specification (1992). For complete information on ODBC error codes and the ODBC API SQLError function, see the Microsoft ODBC Programmer's Reference in the Microsoft ODBC Software Development Kit version 2.10.

Argument

Explanation

ErrorNum

A row number between 1 and the value returned by the SQLCountErrors function (1 is the first available item).


SQLSTATE, the five-character string value returned by SQLErrorClass$, consists of a two-character class value followed by a three-character subclass value. If the error class is not available for the type of error that was encountered, this function returns an empty string ("").

Example

The following example parses the five-character SQLSTATE value returned by SQLErrorClass$ into its class and subclass components.


SQLSTATE$ = SQLErrorClass$(connect_num)
class$ = Left$(2,SQLSTATE$)
subclass$ = Right$(3,SQLSTATE$)