Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.12 Error Messages

DBTools.h++ handles errors differently depending upon how they are generated. The following sections describe error messages used with the Informix Access Library.

2.12.1 Errors and Informix ODBC Driver Conformance

Because DBTools.h++ makes no attempt to simulate behavior that is not provided in the Informix ODBC Driver API and SQL grammar, certain DBTools.h++ functions are reported as errors using the error code RWDBStatus::notSupported. For example, there is no Informix ODBC Driver grammar that generally supports the idea of an RWDBDatabase::createProcedure() function, so it is reported as not supported.

There is a much broader range of possible errors that are most likely to occur during the execution of advanced SQL via a call to SQLExecute(). These errors are reported using the error code RWDBStatus::serverError.

We make no attempt to mitigate against such errors, but when an error does occur, information is transferred to DBTools.h++ objects as described below.

2.12.2 Errors and RWDBStatus

When an error or warning is generated by an access library call to the Informix ODBC Driver API, information about the event is retrieved via a call to SQLGetDiagRec() and transferred to an RWDBStatus. This RWDBStatus object is passed as a parameter to the installed error handler. The following list provides the format that RWDBStatus uses to describe events reported by the Informix ODBC Driver:

An application can use the mapping shown above to write an error handler that reports errors on cerr and issues warnings on clog. For example:

All errors associated with the status will be reported.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.