Connecting to the DB2 Everyplace database

Applications often require creating and accessing tables in a specific location such as C:\TEMP folder on Win32 platforms. You can use the following CLI call to connect to the database specifying the database path:

 rc = SQLConnect(hdbc, "C:\\TEMP\\db", SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS);

where db is the database name (which is ignored by DB2 Everyplace).

In addition, you can use this CLI call:

rc = SQLConnect(hdbc, "C:\\TEMP\\", SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS);

Connecting to extended memory on devices or WinCE object stores requires a special path specification.

Using Command Line Processor, users can connect to a specific location using the "CONNECT TO" command. For example, the following commands will connect to the database that is kept in C:\TEMP\ folder on Win32 platform:

CONNECT TO C:\TEMP\

Zugehörige Konzepte

Zugehörige Tasks