DBGetErr
The DBGetErr function retrieves error codes and error messages from a data server. You can use this function to obtain information when a low-level function returns the result code rcDBError.
FUNCTION DBGetErr (sessID: LongInt; VAR err1: LongInt;
VAR err2: LongInt; VAR item1: Str255;
VAR item2: Str255; VAR errorMsg: Str255;
asyncPB: DBAsyncParmBlkPtr): OSErr;
sessID
- The session ID that was returned by the
DBInit function.
err1
- Returns the primary error code.
err2
- Returns the secondary error code.
item1
- Returns a string that describes the object of the error message.
item2
- Returns a string that describes the object of the error message.
errorMsg
- Returns the error message.
asyncPB
- A pointer to an asynchronous parameter block. If you do not want to call the function asynchronously, set this parameter to
NIL.
DESCRIPTION
If the DBState function returns the rcDBError result code, indicating that execution of a query ended in an error, the error information retuned by DBGetErr can help you debug the query. The meaning of each error code and error message returned by this function depends on the data server with which you are communicating; see the documentation for that data server for more information.
SPECIAL CONSIDERATIONS
The DBGetErr function may move or purge memory. You should not call this routine from within an interrupt, such as in a completion routine or a VBL task.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the DBGetErr function are
| Trap macro | Selector |
| _DBGetErr | $0E0A |
RESULT CODES
| noErr | 0 | No error |
| rcDBError | -802 | Error retrieving error information |
| rcDBBadSessID | -806 | Session ID is invalid |
| rcDBAsyncNotSupp | -809 | The database extension does not support asynchronous calls |
| rcDBPackNotInited | -813 | The InitDBPack function has not yet been called |
SEE ALSO
For a description of the asynchronous parameter block, see page 12-56.