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

SQL Anywhere 11.0.1 (Français) » UltraLite - C and C++ Programming » Application Development » Developing applications using the UltraLite C++ API


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 Messages d'erreur SQL Anywhere triés par code d'erreur Sybase.

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 Messages d'erreur SQL Anywhere triés par code d'erreur Sybase.