C Examples: DbiAddAlias

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiAddAlias

Return to chapter overview

Example 1: Add a STANDARD database alias to the configuration file.

This example uses the following input:
         fDbiAddAlias1("TestAlias", "PATH:C:\\BDE32\\EXAMPLES\\TABLES");

DBIResult fDbiAddAlias1(char *AliasName, char *AliasPath)

{

   DBIResult   rslt;

   rslt = Chk(DbiAddAlias(NULL, AliasName, NULL, AliasPath, TRUE));

   return rslt;

}

 

Example 2: Add an InterBase database alias to the configuration file.

This example uses the following input:
         fDbiAddAlias2("RemoteAlias",
         "PATH:frobosrv:d:/interbas;"
         "SERVER NAME:frobosrv:d:/interbas/slim.gdb;"
         "USER NAME:test;"
         "SQLQRYMODE:SERVER;"
         "SQLPASSTHRU MODE:SHARED NOAUTOCOMMIT");

Note:The last parameter in the string does not have a semicolon (;) at the end.

DBIResult fDbiAddAlias2(char *AliasName, char *AliasPath)

{

   DBIResult   rslt;

   rslt = Chk(DbiAddAlias(NULL, AliasName, "INTRBASE", AliasPath, TRUE));

   return rslt;

}