Board index » delphi » Reading the database path from the BDE Aliases

Reading the database path from the BDE Aliases

I am trying to get the directory where the tables in a specific database
are stored so as to copy all the files to a floppy disk.  The files
could be stored anywhere at install but the BDE alias holds the
pathname.  I am trying to get the path out of the AliasParams property
of the delphi created TSession component.  The docs say that is is a
global variable Session but I cannot seem to access it. Any insight
would be appreciated

thanks

jack

 

Re:Reading the database path from the BDE Aliases


I believe this works on Window NT platforms but not on win95 platforms.
We had a program that used the path to calculate another, but the program
never worked with Win95.

The line of said code was

   dbAlias.Params.Value['PATH']

I have no idea if this helps, it's more of an observation.

Dan Collins
dcoll...@macroent.com

Jack Addington <jmadd...@acs.ucalgary.ca> wrote in article
<32E7E990.2...@acs.ucalgary.ca>...

Quote
> I am trying to get the directory where the tables in a specific database
> are stored so as to copy all the files to a floppy disk.  The files
> could be stored anywhere at install but the BDE alias holds the
> pathname.  I am trying to get the path out of the AliasParams property
> of the delphi created TSession component.  The docs say that is is a
> global variable Session but I cannot seem to access it. Any insight
> would be appreciated

> thanks

> jack

Re:Reading the database path from the BDE Aliases


Jack Addington <jmadd...@acs.ucalgary.ca> skrev i inl?gg
<32E7E990.2...@acs.ucalgary.ca>...

Quote
> I am trying to get the directory where the tables in a specific database
> are stored so as to copy all the files to a floppy disk.  The files
> could be stored anywhere at install but the BDE alias holds the
> pathname.  I am trying to get the path out of the AliasParams property
> of the delphi created TSession component.  The docs say that is is a
> global variable Session but I cannot seem to access it. Any insight
> would be appreciated

> thanks

> jack

Perhaps this code would help:

var
  i : Integer;
  lines : TStringList;
  path : string;
begin

  lines:=TStringList.Create;
  Session.GetAliasParams('FAKTURA',lines);
  for i:=0 to lines.count-1 do
  begin
    if Copy(lines[i],1,5)='PATH=' then
      path:=Copy(lines[i],6,255);
  end;
  lines.Free;

end;

        /Tomas

Re:Reading the database path from the BDE Aliases


I use a TDatabase component to point to different file sets in various
locations then I maintain a list of the TDatabase objects and pass these to
a 3rd party backup control which uses a TMemo to contain a line for each
file set for each TDatabase from the PATH variable.  The backup to floppy
control works great.  Spans multiple disks, LZ compression support, etc...
Real handy.

Jack Addington <jmadd...@acs.ucalgary.ca> wrote in article
<32E7E990.2...@acs.ucalgary.ca>...

Quote
> I am trying to get the directory where the tables in a specific database
> are stored so as to copy all the files to a floppy disk.  The files
> could be stored anywhere at install but the BDE alias holds the
> pathname.  I am trying to get the path out of the AliasParams property
> of the delphi created TSession component.  The docs say that is is a
> global variable Session but I cannot seem to access it. Any insight
> would be appreciated

> thanks

> jack

Re:Reading the database path from the BDE Aliases


On 25 Jan 1997 06:12:29 GMT, "James R Anderson"

Quote
<axp...@sawyer.ndak.net> wrote:
>I use a TDatabase component to point to different file sets in various
>locations then I maintain a list of the TDatabase objects and pass these to
>a 3rd party backup control which uses a TMemo to contain a line for each

  ^^^^^^^^^^^^^^^^^^^^^^
               ???

Quote
>file set for each TDatabase from the PATH variable.  The backup to floppy
>control works great.  Spans multiple disks, LZ compression support, etc...
>Real handy.

Hi,

Could you tell me which backup control you are using ?

Thanks !

Thomas Marti

(101615.1...@compuserve.com)

Other Threads