C Examples: DbiInit

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiInit

Return to chapter overview

Example 1: Initialize BDE with default settings.

It is strongly recommended to use this method. This example uses the following input:
         fDbiInit1();

DBIResult fDbiInit1()

{

   DBIResult      rslt;

   rslt = Chk(DbiInit(NULL));

   return rslt;

}

 

Example 2: Initialize BDE with a different working directory.

It is not recommended to use this method for most cases. This example uses the following input:
         fDbiInit2("c:\\program\\tables);

DBIResult fDbiInit2(pCHAR WorkDir)

{

   DBIResult      rslt;

   DBIEnv         Env;

   memset(&Env, 0, sizeof(DBIEnv));

   strcpy(Env.szWorkDir, WorkDir);

   rslt = Chk(DbiInit(&Env));

   return rslt;

}

 

Example 3: Initialize BDE with a different configuration file.

It is not recommended to use this method for most cases. This example uses the following input:
         fDbiInit3("c:\\myidapi\\idapi32.cfg");

DBIResult fDbiInit3(pCHAR ConfigDir)

{

   DBIResult      rslt;

   DBIEnv         Env;

   memset(&Env, 0, sizeof(DBIEnv));

   strcpy(Env.szIniFile, ConfigDir);

   rslt = Chk(DbiInit(&Env));

   return rslt;

}