Error and Message Handling

DB Library for C

DB Library for C

Error and Message Handling

DB-Library for C applications deal with errors and messages: Messages generated by DB-Library for C functions are called errors and those from Microsoft® SQL Server™ 2000 are known as messages. SQL Server can return both informational and error messages to the application. In addition, DB-Library for C has its own set of possible warnings and errors. A list of SQL Server messages appears in the sysmessages table. For more information about a list of DB-Library for C errors, see Error Messages.

DB-Library for C easily centralizes error and message handling. With dbmsghandle and dberrhandle, you can install your own message- and error-handling functions. When a message or error occurs, DB-Library for C automatically calls the appropriate user-supplied function, providing information to that function on the nature of the message or error, thus the error- and message-handling logic can be assigned to two functions in your application.