When you access an ODBC data source in the PocketBuilder development environment, there are several initialization files and registry entries on your computer that work with the ODBC interface and driver to make the connection.
The PKODB20 initialization file maintains access to extended functionality in the back-end DBMS, for which ODBC does not provide an API call. Examples of extended functionality are SQL syntax or DBMS-specific function calls.
In most cases, you do not need to edit the PKODB20 initialization file. In certain situations, however, you may need to add functions to the PKODB20 initialization file for your DBMS.
For instructions, see “The PKODB20 initialization file”.
The ODBCINST initialization information is located in the HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI registry key. When you install an ODBC-compliant driver, ODBCINST.INI is automatically updated with a description of the driver.
This description includes:
The DBMS or data source associated with the driver
The drive and directory of the driver and setup DLLs (for some data sources, the driver and setup DLLs are the same)
Other driver-specific connection parameters
You do not need to edit the registry key directly to modify connection information.The key is automatically updated when you install the driver.
ODBC initialization information is located in the HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI registry key. When you define a data source, the driver writes the values you specify in the ODBC setup dialog box to the ODBC.INI registry key.
The ODBC.INI key contains subkeys named for each defined data source. Each subkey contains the values specified for that data source in the ODBC setup dialog box. The values include the following:
Database file
Driver
Optional description
Connection parameters
Do not edit the ODBC subkey directly to modify connection information. Instead, use a tool designed to define ODBC data sources and the ODBC configuration automatically, such as the ODBC Data Source Administrator.
Database profiles for all data sources are stored in the registry in HKEY_CURRENT_USER\SOFTWARE\Sybase\PocketBuilder\2.0\ DatabaseProfiles.
You should not need to edit the profiles directly to modify connection information. These files are updated automatically when PocketBuilder creates the database profile as part of the ODBC data source definition.
You can also edit the profile in the Database Profile Setup dialog box or complete the Database Preferences dialog box in PocketBuilder to specify other connection parameters stored in the registry. (For instructions, see Chapter 18, “Setting Additional Connection Parameters.”)
The following example shows a portion of a database profile for the SQLAny Demo data source:
DBMS=ODBC Database=SQL Anywhere Demo DB UserId=dba DatabasePassword= LogPassword= ServerName= LogId= Lock= DbParm=ConnectString='DSN=SQLAny Demo;UID=dba;PWD=sql' Prompt=0
This registry entry example shows the two most important values in a database profile for an ODBC data source:
DBMS The DBMS value (ODBC) indicates that you are using the ODBC interface to connect to the data source.
DBParm The ConnectString DBParm parameter controls your ODBC data source connection. The connect string must specify the DSN (data source name) value, which tells ODBC which data source you want to access. When you select a database profile to connect to a data source, ODBC looks in the ODBC.INI registry key for a subkey that corresponds to the data source name in your profile. ODBC then uses the information in the subkey to load the required libraries to connect to the data source. The connect string can also contain the UID (user ID) and PWD (password) values needed to access the data source.