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

SQL Anywhere 12.0.1 » UltraLite - C and C++ Programming » Application development » UltraLite C++ application development


Error handling

The UltraLite C++ API includes a ULError object that should be used to retrieve error information. Several methods in the API return a boolean value, indicating whether the method call was successful. In some instances, null is returned when an error occurs. The ULConnection object contains a GetLastError method, which returns a ULError object.

Use SQLCode to diagnose an error. In addition to the SQLCode, you can use the GetParameterCount and GetParameter methods to determine whether additional parameters exist to provide additional information about the error.

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.

 See also