Extracting path from BDE alias or database? 
Author Message
 Extracting path from BDE alias or database?
Can anyone please tell me if there is a way to extract the file path
using the BDE alias or databasename?


Wed, 18 Jun 1902 08:00:00 GMT
 Extracting path from BDE alias or database?

This is what I did with a table in the DBDEMOS alias:

 Table1.open;
   showmessage(Session.PrivateDir);

Hope that helps

********************************
Michael Glatz




Wed, 18 Jun 1902 08:00:00 GMT
 Extracting path from BDE alias or database?

Quote:

> Can anyone please tell me if there is a way to extract the file path
> using the BDE alias or databasename?

Phil,

Function  GetPathFromAlias(Alias:string):string;
var
   x:TStringList;
   i:integer;
begin
     result:='';
     if (Session <> nil) then begin
       x:=TStringList.Create;
       try
          Session.GetAliasParams(alias,x);
          for i:=0 to pred(x.count) do begin
            if (Copy(x.strings[i],1,5) = 'PATH=' )then begin
              Result:=Copy(x.strings[i],6,255);
            end;
          end;
       finally
          x.free;
       end;
     end;
end;

Hope this helps (it works for me!),
Frank



Wed, 18 Jun 1902 08:00:00 GMT
 Extracting path from BDE alias or database?

Quote:

> Can anyone please tell me if there is a way to extract the file path
> using the BDE alias or databasename?

Phil,

Function  GetPathFromAlias(Alias:string):string;
var
   x:TStringList;
   i:integer;
begin
     result:='';
     if (Session <> nil) then begin
       x:=TStringList.Create;
       try
          Session.GetAliasParams(alias,x);
          for i:=0 to pred(x.count) do begin
            if (Copy(x.strings[i],1,5) = 'PATH=' )then begin
              Result:=Copy(x.strings[i],6,255);
            end;
          end;
       finally
          x.free;
       end;
     end;
end;

Hope this helps (it works for me!),
Frank



Wed, 18 Jun 1902 08:00:00 GMT
 Extracting path from BDE alias or database?

Quote:

> Can anyone please tell me if there is a way to extract the file path
> using the BDE alias or databasename?

Phil,

Function  GetPathFromAlias(Alias:string):string;
var
   x:TStringList;
   i:integer;
begin
     result:='';
     if (Session <> nil) then begin
       x:=TStringList.Create;
       try
          Session.GetAliasParams(alias,x);
          for i:=0 to pred(x.count) do begin
            if (Copy(x.strings[i],1,5) = 'PATH=' )then begin
              Result:=Copy(x.strings[i],6,255);
            end;
          end;
       finally
          x.free;
       end;
     end;
end;

Hope this helps (it works for me!),
Frank



Wed, 18 Jun 1902 08:00:00 GMT
 Extracting path from BDE alias or database?
try this function. I've used it in D3.
David

function GetDataBaseDir(const Alias : string): String;
var
  dbDes: DBDesc;
begin

  with dbDes do
    Result := szPhyName;
end; // end of GetDataBaseDir

Quote:

>Can anyone please tell me if there is a way to extract the file path
>using the BDE alias or databasename?



Wed, 18 Jun 1902 08:00:00 GMT
 Extracting path from BDE alias or database?
Glatzfamly,

How can I define the path for an alias.
Example. I have a project that work with various subdirectory and I use
an alias. So, I need change the paht of the alias to change the
database.

Thanks,

Rogerio Cardoso

Glatzfamly escreveu:

Quote:
> This is what I did with a table in the DBDEMOS alias:

>  Table1.open;
>    showmessage(Session.PrivateDir);

> Hope that helps

> ********************************
> Michael Glatz





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

 Relevant Pages 

1. Reading the database path from the BDE Aliases

2. Extract full path for alias : how?

3. gettting BDE alias path

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

5. how to get BDE Alias path

6. Help needed.......creating aliases for database paths??????

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

8. Extracting database type from the BDE.

9. Help - programmatically extracting column names and alias from views

10. Finding the path for an alias

11. How to get the path from an alias

12. extracting path from filebrowser


 
Powered by phpBB® Forum Software