If an EDS command other than EDSError returns EDS_SUCCESS_WITH_INFO or EDS_ERROR, call EDSError to obtain additional information. This additional error or status information can come from one of two sources:
•An ODBC command called by EDS, indicating that a programming error was detected.
•The data source, indicating that an error occurred during SQL statement processing.
EDSError will return the SQLSTATE code that is specific to the error condition. The SQLSTATE code describes the condition of the environment handle, the connection handle, and the statement handle. EDSError also returns a native error code that is specific to the data source and the text of the error message. The SQLSTATE code and the native error code give you specific information about the error. Your application must handle the error condition .
EDS may store multiple errors for the command in the driver’s error buffer. After the driver has executed the command and supplied a return code, you can call EDSError to return error messages for the command. Each time the application calls EDSError, the driver returns the next error message in the buffer. Your application can call EDSError repeatedly, until EDS_NO_DATA_FOUND is returned. When the application calls a different command, the driver discards the current contents of the error message buffer. Note that EDSError never returns error information about itself.
For a list of error codes and the functions that return them, see EDS ODBC Error Codes.