Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Access Module for ODBC User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.13 Error Messages

SourcePro DB handles errors differently depending upon how they are generated. The following sections describe error messages used with the DB Access Module for ODBC.

2.13.1 Errors and ODBC Conformance

Because the DB Interface Module does not simulate behavior that is not provided in the ODBC API and ODBC SQL grammar, certain functions of the DB Interface Module are reported as errors using the error code RWDBStatus::notSupported. For example, there is no ODBC 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 depend entirely on the underlying ODBC driver in use. Errors of this sort 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.

SourcePro DB makes no attempt to mitigate against such errors, but when an error does occur, information is transferred to DB Interface Module objects as described below.

2.13.2 Errors and RWDBStatus

When an error or warning is generated by an Access Module call to the ODBC 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 ODBC driver:

An application can use the mapping shown previously 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 DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.