DB-Library returns Microsoft® SQL Server™ errors and messages to call-back functions, written by the application programmer.
The application programmer uses the dberrorhandle function to give DB-Library the address of the call-back function that handles the errors. When DB-Library determines that an error has occurred, it calls the call-back function identified by dberrorhandle. DB-Library passes the SQL Server error information into the parameters of the call back function as described below:
The application programmer uses the dbmsghandle function to give DB-Library the address of the call-back function that handles the messages. When DB-Library receives an informational message from SQL Server, it calls the call-back function identified by dbmsghandle.
DB-Library passes the SQL Server message information into the parameters of the call-back function as described below:
DB-Library calls the application error handler and message handler functions asynchronously as packets containing messages and errors are received from the server. This means DB-Library applications may receive errors and messages in a slightly different sequence than applications using either the OLE DB Provider for SQL Server or the SQL Server ODBC Driver.