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

2.12 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 Microsoft SQL Server.

2.12.1 Errors and ODBC Conformance

SourcePro DB makes no attempt to simulate behavior that is not provided in the ODBC API, the ODBC SQL grammar, and Microsoft SQL Server ODBC extensions. For this reason, certain functions of the DB Interface Module are reported as errors using the error code RWDBStatus::notSupported. For example, the RWDBValue::MBString data type is not supported, so attempts to use this type are reported as not supported.

A broad range of possible errors can originate from the Microsoft SQL Server ODBC driver, the Microsoft ODBC driver manager, the underlying network library, or the SQL Server. These errors are reported using the error code RWDBStatus::serverError. The source of the error can be determined from the message reported by the RWDBStatus::vendorMessage2() method, which contains the message header returned by the driver. Please see the Microsoft SQL Server ODBC driver documentation for more information regarding message headers.

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

2.12.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 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 DocumentContentsIndex pageNext 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.
Contact Rogue Wave about documentation or support issues.