gettting BDE alias path 
Author Message
 gettting BDE alias path
Is there a function call to get the directory path of a BDE alias?  In other
words, I KNOW what the alias of the table to be used is, but I need to get
the directory path.  I want to get this info. without starting a session or
opening a table.

If you could give me a reference, I would appreciate it.

-Ed



Wed, 18 Jun 1902 08:00:00 GMT
 gettting BDE alias path


Quote:
> Is there a function call to get the directory path of a BDE alias?  In
other
> words, I KNOW what the alias of the table to be used is, but I need to get
> the directory path.  I want to get this info. without starting a session
or
> opening a table.

I'm not sure why you say "without starting a session". A default session is
automatically started at runtime if your app uses any database controls -
that is, if any of your forms uses DB.pas. The initialization of DB.pas does
this...
  Sessions := TSessionList.Create;
  Session := TSession.Create(nil);
  Session.SessionName := 'Default';

So the simplest way to convert an alias to a path is...

uses DB;

function AliasLocation(const Alias: string): string;
var
  AliasParams: TStringList;
begin
  AliasParams := TStringList.Create;
  try
    Session.GetAliasParams(Alias, AliasParams);
    Result := AliasParams.Values['Path'];
  finally
    AliasParams.Free;
  end;
end;

--
Stephen Brown



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Change path of BDE-alias at run-time

2. Extracting path from BDE alias or database?

3. how to get BDE Alias path

4. Reading the database path from the BDE Aliases

5. BDE Alias's and new installs of the BDE

6. Alias Path?

7. How to use aliases in a search paths

8. Different access path when going through alias?

9. Alias path

10. aliases path at run time

11. Extract full path for alias : how?

12. Dynamic Table Creation causes Alias Path Error


 
Powered by phpBB® Forum Software