C Examples: DbiSetPrivateDir

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiSetPrivateDir

Return to chapter overview

Set the private directory.

C++Builder programs using the VCL for data access should use the TSession::PrivateDir property rather than using the dbi function directly.

If the main directory cannot be set, the function attempts to set a backup directory. This example uses the following input:
         fDbiSetPrivateDir("c:\\temp", "c:\temp", &Main);

DBIResult fDbiSetPrivateDir(pCHAR MainDir, pCHAR BackupDir, pBOOL Main)

{

   DBIResult rslt;

   rslt = Chk(DbiSetPrivateDir(MainDir));

   if (rslt == DBIERR_NONE)

      *Main = TRUE;

   else

   {

     rslt = Chk(DbiSetPrivateDir(BackupDir));

     if (rslt == DBIERR_NONE)

        *Main = FALSE;

   }

   return rslt;

}