MDAC 2.5 SDK - Visual FoxPro ODBC Driver


 

Error Messages

When an error occurs, the Visual FoxPro driver returns the following information:

You access this error information by calling SQLError.

Native Errors

For errors that occur in the data source, the Visual FoxPro driver returns the native error number and error message text. For a list of native error numbers, see Visual FoxPro ODBC Driver Native Error Messages.

SQLSTATE (ODBC Error Codes)

For errors that are detected and returned by the Visual FoxPro driver, the driver maps the returned native error number to the appropriate SQLSTATE. If a native error number does not have an ODBC error code to map to, the Visual FoxPro driver returns SQLSTATE S1000 (General error).

For a list of SQLSTATE values generated by the Visual FoxPro ODBC Driver for corresponding Visual FoxPro errors, see ODBC Error Codes.

Syntax

Error messages have the following format:

[vendor][ODBC_component]error_message

The prefixes in brackets ([ ]) identify the source of the error as defined in the following table.

Data source Prefix Value
Driver Manager [vendor]
[ODBC_component]
[data_source]
[Microsoft]
[ODBC Driver Manager]
N/A
Visual FoxPro driver vendor]
[ODBC_component]
[data_source]
[Microsoft]
[ODBC Visual FoxPro driver]
N/A

For example, if the Visual FoxPro ODBC Driver could not find the file employee.dbf, it might return the following error message:

"[Microsoft][ODBC Visual FoxPro Driver]File 'employee.dbf' does not exist"