dbGetErrorText

Top  Previous  Next

Syntax

STRING = dbGetErrorText(hstmt as INT)

Description

Returns the ODBC error text for a statement, if any.

Parameters

hstmt - Statement handle created with dbExecSQL or dbPrepareSQL

Return value

A string containing the ODBC error text, or an empty string if no error has occurred.

Remarks

For the ODBC error code use dbGetErrorCode.

See Also: dbGetErrorCode

Example usage

hstmt = dbExecSQL(pdb,"SELECT * FROM Addresses")
error = dbGetErrorCode(hstmt)
IF LEN(error)
    PRINT
    PRINT "Error Code: ", error
    PRINT "Error Text: ", dbGetErrorText(hstmt)
    PRINT
ENDIF