Autor Beitrag
Scotch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101


Delphi 6 Prof
BeitragVerfasst: Di 12.11.02 20:59 
Hallo NG,
wie kann ich den Path meiner DB-Dateien auslesen (String) unter Zuhilfenahme
des Alias???
Da ich in dem selben Verzeichnis auch noch eine zusätzliche Datei mit
hineinpacken möchte, aber
nach einer Installation den absoluten Phat nicht unbedingt kenne, Brauche
ich den Path des Alias.

Ich hoffe ich habe mich nicht zu umständlich ausgedrückt.

CU Scotch
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Mi 13.11.02 08:48 
Hi
Mit Hilfe von Session kannst du die aktuellen Parameter des Alias abfragen und daraus wiederum kannst du auch den Pfad entnehmen.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
function GetDbPath(Alias: string): string;
var
  plst : TStringList;
begin
  result := '';
  plst := TStringList.Create;
  try
    Session.GetAliasParams(Alias, plst);
    result := plst.Values['Path'];
  finally
    plst.Free;
  end;
end;

So wie geschrieben funktioniert das mit Standard-Datenbanken. Bei Zugriff auf IB, Access oder andere Datenbanken, steht der Pfad meistens zusammen mit dem Datenbanknamen in einem Eintrag Database o. ä. Das müsste dann entsprechend angepasst werden.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Scotch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101


Delphi 6 Prof
BeitragVerfasst: Mi 13.11.02 18:27 
Hallo LCS,

Danke für die Antwort, klappt super.

cu Scotch