Board index » delphi » D2: Resolve Alias to Path

D2: Resolve Alias to Path

Hallo,

has anyone an idea to resolve a temporary alias created by the Tdatabase
component back to the actual pathname
of a Paradox or dBase database

many thanks

Klaus J. Uttendorf

 

Re:D2: Resolve Alias to Path


This works for regular aliases, and may work for the temporary aliases, too.

procedure GetDatabaseDesc (const DBName: String; var DbType, Name, Text,
PhyName: string);
{ Code to call BDE shown here for reference. }
var dbDes: DBDesc;
begin
  Check(DbiGetDatabaseDesc(PChar(DBName), @dbDes));
  With dbDes do begin
    DbType := szDbType;
    Name   := szName;
    Text   := szText;
    PhyName:= szPhyName;
    end;
end;

Quote
Klaus J. Uttendorf wrote in message <7hh8ad$2b...@forums.borland.com>...

>has anyone an idea to resolve a temporary alias created by the Tdatabase
>component back to the actual pathname
>of a Paradox or dBase database

Re:D2: Resolve Alias to Path


Quote
Klaus J. Uttendorf wrote in message

<7hh8ad$2b...@forums.borland.com>...

Quote
>has anyone an idea to resolve a temporary alias created by the
Tdatabase
>component back to the actual pathname of a Paradox or dBase database

Klaus,

I haven't tried this on a temporary alias...

function AliasLocation(const Alias: string): string;
//Returns the fully-qualified path to a BDE alias
var
  AliasParams: TStringList;
begin
  AliasParams := TStringList.Create;
  try
    Session.GetAliasParams(Alias, AliasParams);
    Result := AliasParams.Values['Path'];
  finally
    AliasParams.Free;
  end;
end;

--
Stephen Brown

Other Threads