
The RWDBConnection::systemHandle() method returns a pointer to a base class from which a family of implementation-specific classes is derived. To use the database API directly, an application can downcast this pointer to the appropriate type, and use its implementation-specific features. Naturally, this usage reduces an application's portability.
In the case of an ODBC connection, the implementation-specific system handle has the datatype RWDBODBCLibSystemHandle. It contains the SQLHDBC used by the RWDBConnection. The following method may be used to retrieve this component:
SQLHDBC hdbc();
If it is necessary for your application to make calls directly to the ODBC API, proceed as in the following example:
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <rw/db/odbcsrc/odbsysh.h>
RWDBConnection odbcConnect = myDbase.connection();
RWDBODBCLibSystemHandle* handle = (RWDBODBCLibSystemHandle *)
odbcConnect.systemHandle();
SQLHDBC sqlhdbc = handle->hdbc();
// Use sqlhdbc for ODBC API calls.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.