曹大虾说对了,在 TSession 下有这么几个方法:
TSession.AddAlias
TSession.AddStandardAlias
TSession.DeleteAlias
TSession.ModifyAlias
详见Delphi的帮助文件, 都有简单的举例。下面是一个Paradox的实例:
Procedure TForm1.Button1Click(Sender: TObject);
begin
with Session1 do
begin
ConfigMode := cmSession;
try
AddStandardAlias('MyNewAlias', 'C:/Temp', 'PARADOX');
finally
ConfigMode := cmAll;
end;
end;