Initializing BDE

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Initializing BDE

Return to chapter overview

The first call that the application makes to the Borland Database Engine (BDE) is always DbiInit, to initialize the database engine and start a new session. DbiInit can optionally be supplied with a pointer to the environment information structure DBIEnv. The NULL pointer is normally passed, which forces BDE to search for the Registry entries and the BDE configuration file (BDE.CFG), and to use the default settings. When a NULL pointer to the DBIEnv structure is passed, BDE searches in the following order for the configuration file:

1.        BDE checks the Windows Registry for a configuration file defined by an entry of [BDE] with a subentry of CONFIGFILE01.
2.        If step 1 is not successful, BDE checks for the configuration file named IDAPI.CFG in the startup directory.
3.        If step 2 is not successful, BDE initializes with a default set of configuration settings, predefined for each driver. If initialization takes place after the failure of steps 1 and 2, no SQL driver access is possible.

If the pointer is not NULL, and the configuration file is specified in the DBIEnv structure, BDE uses that configuration file.

Here is a sample DbiInit call:

// Initialize IDAPI
rslt = DbiInit(NULL);

 

 Preparing to access a table%!AL(`preparingtoaccess')

 Accessing and updating tables%!AL(`accessingtables')

See also: Initialization