This section describes the arguments required to create an instance of RWDBDatabase for the Sybase CT access library.
In order for a DBTools.h++ application to open and use the connections required for interacting with a database, an RWDBDatabase instance must be created by calling:
RWDBManager::database(accessLib, serverName, userName, passWord, databaseName);
All arguments are of type RWCString. For Client-Library, you must provide the following arguments:
accessLib: If you are using DLLs or shared libraries, provide their names. If you are using a static library, supply the string SYBASE_CT. See the DBTools.h++ Build Guide for information about naming conventions.
serverName: Supply the name of the server to which you are connecting, as found in your local interfaces or sql.ini file. Most likely, this will be some version of Adaptive Server.
userName: Supply the server login name for a valid user.
passWord: Supply the password for the user.
databaseName: You can optionally supply the name of a server database to use. If this parameter is not supplied, the default database of the specified user is used.
Here are three examples of opening a database on a specific server, INHOUSE.
The first example opens a specific database, ACCOUNTING. A user name and a password are given to provide the highest level of security. Notice that the accessLib is defined as SYBASE_CT, indicating that the application must be linked with the static version of the access library:
RWDBManager::database("SYBASE_CT", "INHOUSE", "cratchitt", "scrooge", "ACCOUNTING");
The second example shows opening the same database from a MS Windows-NT application. In this case, the accessLib is defined as ctl4d.dll, indicating that the application will dynamically load (DLL) the access library at runtime:
RWDBManager::database("ctl4d.dll", "INHOUSE", "cratchitt","scrooge", "ACCOUNTING");
The final example shows opening a user's default database, that is, the database assigned to the user by the database administrator. In this case, an application will use the access library as an UNIX shared library at runtime:
RWDBManager::database("libctl0d.so", "INHOUSE", "cratchitt", "scrooge", "");
The library name and path shown are for Solaris.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.