Board index » delphi » BDE Alias path

BDE Alias path

Hi, people.

I'd like to know if there's a function that, given a BDE alias, returns its
path.

In my application I have an alias SISVEST.  Since the tables can be put in
other directory when the user installs the program, I need a way to know
exactly where the tables were copied to.

Thanx for the help.

Breno.
bren...@nutecnet.com.br

 

Re:BDE Alias path


var ParamsList: Tstrings;
    MyAliasPath: String;

const AliasName='MyAlias';

begin
  ParamsList:= TStringList.Create;
  try
    with Session do
    begin
      Session.GetAliasNames(ParamsList);
      Session.GetAliasParams(AliasName,ParamsList);
      MyAliasPath:=Copy(ParamsList[0],6,50)+'\';
    end;

  finally
    ParamsList.Free;
  end;
end;

Breno <bren...@nutecnet.com.br> wrote in article
<01bc4174$6c837ea0$LocalHost@brenodm>...

Quote
> Hi, people.

> I'd like to know if there's a function that, given a BDE alias, returns
its
> path.

> In my application I have an alias SISVEST.  Since the tables can be put
in
> other directory when the user installs the program, I need a way to know
> exactly where the tables were copied to.

> Thanx for the help.

> Breno.
> bren...@nutecnet.com.br

Re:BDE Alias path


Quote
Breno wrote:

> Hi, people.

> I'd like to know if there's a function that, given a BDE alias, returns its
> path.

> In my application I have an alias SISVEST.  Since the tables can be put in
> other directory when the user installs the program, I need a way to know
> exactly where the tables were copied to.

> Thanx for the help.

> Breno.
> bren...@nutecnet.com.br

I think the following will help. If you have Delpi 2.0, take a look at
the BDE32.hlp. It should be installed to:

"C:\Program Files\Borland\Common Files\BDE\BDE32.HLP"

FullName:=fDbiFormFullName(Table1);

function fDbiFormFullName(Tbl: TTable): String;
var
  Props: CurProps;
begin
  Check(DbiGetCursorProps(Tbl.Handle,Props));
  SetLength(Result, DBIMAXPATHLEN);
  Check(DbiFormFullName(Tbl.DBHandle, PChar(Tbl.TableName),
          Props.szTableType, PChar(Result)));
end;

Joe
--
Joe C. Hecht
(Borland Delphi Developer Support)
Join the Delphi Online Discussion Forum at
http://www.borland.com/techsupport/delphi/

Re:BDE Alias path


Quote
Breno wrote:

> I'd like to know if there's a function that, given a BDE alias,
> returns its path.

> In my application I have an alias SISVEST.  Since the tables can be
> put in other directory when the user installs the program, I need a
> way to know exactly where the tables were copied to.

  Granted, this is not what you're looking for, but don't use an
Alias...  I load all my stuff at run-time, and have never used an alias
in any of my database apps,  It doesn't matter where the tables are, my
apps. load them (even if the user decides to move them later on down the
road, after the program's been installed....)

--
Jason
Dark...@SLSoftware.reno.nv.us

Re:BDE Alias path


Jason, why not use Alias'? How are you doing the loading at start?
Determining where your databases are that is? Just curious!
--

==================================================                        
Scott Simonson from Franklin WI
 EMail:    sco...@execpc.com
 Web Page: http://www.execpc.com/~scoots                            

**************************************************
******** Way to Go Green Bay Packers *************
********      Superbowl Champs       *************
**************************************************
==================================================

Jason Wallace <Dark...@SLSoftware.reno.nv.us> wrote in article
<334A1ADB....@SLSoftware.reno.nv.us>...

Quote
> Breno wrote:

> > I'd like to know if there's a function that, given a BDE alias,
> > returns its path.

> > In my application I have an alias SISVEST.  Since the tables can be
> > put in other directory when the user installs the program, I need a
> > way to know exactly where the tables were copied to.

>   Granted, this is not what you're looking for, but don't use an
> Alias...  I load all my stuff at run-time, and have never used an alias
> in any of my database apps,  It doesn't matter where the tables are, my
> apps. load them (even if the user decides to move them later on down the
> road, after the program's been installed....)

> --
> Jason
> Dark...@SLSoftware.reno.nv.us

Other Threads