|
<< Click to Display Table of Contents >> Delphi Examples: DbiAddAlias |
![]() ![]()
|
Example 1: Add a STANDARD database alias to the configuration file.
This example uses the following input:
fDbiAddAlias1('TestAlias', 'PATH:C:\BDE32\EXAMPLES\TABLES');
procedure fDbiAddAlias1(AliasName, AliasPath: string);
begin
Check(DbiAddAlias(nil, PChar(AliasName), nil, PChar(AliasPath), True));
end;
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.
procedure fDbiAddAlias2(AliasName, AliasPath: string);
begin
Check(DbiAddAlias(nil, PChar(AliasName), 'INTRBASE', PChar(AliasPath), True));
end;