Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.2 Databases and Connections

In order for a DBTools.h++ application to open and use the connections required for interacting with a database, you must create an RWDBDatabase instance by calling:

These arguments, which are all of type RWCString, are used to build a connect string that is passed to the ODBC API function SQLDriverConnect(). This string takes the form:

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

Here are three examples of opening a database on a specific SQL server, INHOUSE.

The first example opens a specific database, ACCOUNTING. Notice that the accessLib is defined as MS_SQL, indicating that the application must be linked with the static version of the access library:

The second example shows opening the same database from a Windows NT or Windows 95 application. In this case, the accessLib is defined as msq4d.dll, indicating that the application will dynamically load the access library at runtime:

The final example demonstrates how to open a user's default database, which is the database assigned to the user by the database administrator:


Previous fileTop of DocumentContentsIndexNext file

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