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.2 Databases and Connections

This section describes the arguments used to build a connect string to an ODBC database. In order for a SourcePro DB application to interact with a database, an RWDBDatabase instance must be created by calling:

All arguments are of type RWCString. These parameters are used to build a connect string which is passed to the ODBC API function SQLDriverConnect(). The string is of the form:

The arguments you must provide to RWDBManager::database() are:

Here are several examples of opening a database.

The first example uses a driver to access dBase tables. A user name and password are not necessary. Notice that accessLib is defined as "odb8012d.dll", indicating that the application will dynamically load (DLL) the Access Module at runtime:

The second example uses a driver to access Paradox tables. Again, a user name and password are unnecessary, and omitted. Notice that accessLib is defined as "ODBC", indicating that the application must be linked with the static version of the Access Module:

The third example uses a driver to access a Microsoft database server named "Microsoft SQL Server". A user name and password are provided. Notice that accessLib is defined as "odb8012d.dll", indicating that the application will dynamically load (DLL) the Access Module at runtime:

The final example uses a driver on a Unix machine to access a Sybase ASE server with a Data Source Name of "Sybase". Notice that accessLib is defined as "libodb8012d.so", indicating that the application will use the Access Module as a UNIX shared library at runtime:



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.