Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - C and C++ Programming » Developing Applications Using the UltraLite C++ API

Accessing schema information Next Page

Handling errors


You should check for errors after each database operation by using methods of the ULSqlca object. For example, LastCodeOK checks if the operation was successful, while GetSQLCode returns the numerical value of the SQLCode. For more information about the meaning of these values, see Error messages sorted by Sybase error code.

In addition to explicit error handling, UltraLite supports an error callback function. If you register a callback function, UltraLite calls the function whenever an UltraLite error occurs. The callback function does not control application flow, but does enable you to be notified of all errors. Use of a callback function is particularly helpful during application development and debugging. For more information about using the callback function, see Tutorial: Build an Application Using the C++ API.

For a sample callback function, see Callback function for ULRegisterErrorCallback and ULRegisterErrorCallback function.

For a list of error codes thrown by the UltraLite C++ API, see Error messages sorted by Sybase error code.