uses DBTables;
procedure TForm1.Button1Click(Sender: TObject);
var CurrentAliases: TStringList;
begin
CurrentAliases := TStringList.Create;
Session.GetAliasNames(CurrentAliases);
ComboBox1.Items:= CurrentAliases;
CurrentAliases.Free;
end;
uses DBTables;
...
var sMaybeAlias : string;
...
Session.IsAlias(sMaybeAlias)
...
uses dbtables;
procedure TForm1.Button1Click(Sender: TObject);
var sMaybeAlias : string;
DBPath : string;
ParamList : TStringList;
begin
sMaybeAlias := 'DBDEMOS';
if Session.isAlias(sMaybeAlias) then
begin
ParamList := TStringList.Create;
try
Session.GetAliasParams(sMaybeAlias, ParamList);
DBPath := ParamList.Values['PATH'];
finally
ParamList.Free;
end;
ShowMessage('Path to '+sMaybeAlias+' is '+DBPath);
end
else ShowMessage(sMaybeAlias+' is not an alias!');
end;
...
sNewAlias := 'MyNewParadoxAlias'
sDataDir := 'c:\MyApplication\NewDataDirectory'
Session.AddStandardAlias
(sNewAlias, sDataDir, 'PARADOX');
...
uses dbtables;
procedure TForm1.Button1Click(Sender: TObject);
var AliasParams : TStringList;
AliasDirectory : string;
AliasName : string;
begin
AliasDirectory:='c:\MyApp\Data\IBData.GDB';
AliasName:='IBNewData';
AliasParams := TStringList.create;
try
AliasParams.Values['SERVER NAME'] := DataFile;
AliasParams.Values['USER NAME'] := 'SYSDBA';
Session.AddAlias
(AliasName, 'INTRBASE', AliasParams);
Session.SaveConfigFile;
finally
AliasParams.Free;
end;