Board index » delphi » How to create ODBC-Alias at runtime ?

How to create ODBC-Alias at runtime ?

Hi,
 who can show me, how i can create an ODBC Alias at runtime ?

bye  erik brunn

 

Re:How to create ODBC-Alias at runtime ?


erik brunn <br...@nwn.de> napisa3(a) w artykule
<37B9AF4B.551BA...@nwn.de>...

Quote
> Hi,
>  who can show me, how i can create an ODBC Alias at runtime ?

> bye  erik brunn

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;

These sample codes are taken from BDE32.HLP, but as far as I know to
use this function You
must declare DBIPROCS to uses clause.

--
______________________________________________
Michal Piasecki

Other Threads