Q: 如何取得 Alias 的實際路徑? A: 參考下面兩個副程式: // 取得 dBase/Paradox 資料庫路徑 function GetStdAliasPath(const sAliasName: String): string; var szName: array[0..99] of char; Desc: DBDesc; wResult: DBIResult; begin Result := ''; StrPCopy(szName, sAliasName); wResult := DbiGetDatabaseDesc(szName, @Desc); if (wResult = DBIERR_NONE) then Result := Desc.szPhyName; end; // 取得 dBase/Paradox, native MSACESS, InterBase // 的資料庫存放路徑 Function GetAliasPath(const sAlias: string): string; var DriverName: string; ParamList: TStringList; s: string; begin Result := ''; ParamList := TStringList.Create; try Session.GetAliasParams(sAlias, ParamList); DriverName := Session.GetAliasDriverName(sAlias); s := 'PATH'; if (DriverName = 'MSACCESS') then s := 'DATABASE NAME' else if (DriverName = 'INTRBASE') then s := 'SERVER NAME'; Result := ExtractFilePath(ParamList.Values[s]); finally ParamList.Free; end; end;