刪除:其中'CostingDB'為數據庫別名
Session.DeleteAlias('CostingDB');
Session.SaveConfigFile;
如還有問題 QQ :112925366另外還有一種判斷的方法,以下為一個實例:
Procedure TBasDM.LoginServer;
var tempIni: TIniFile;
tmpServerFrm: TServerFrm;
i:Integer;
tmpList:TStringList;
IsAliasName:Boolean;
begin IsAliasName:=false;
tmpList:= TStringList.Create;
try
Session.GetAliasNames(tmpList);
for I := 0 to tmpList.Count - 1 do
if tmpList[i]='CostingDB' then
IsAliasName:=true; if not IsAliasName then
Session.AddAlias('CostingDB','MSSQL',CostDB.Params);
finally
tmpList.Free;
end; ......end;
Session.DeleteAlias('CostingDB');
Session.SaveConfigFile;
如還有問題 QQ :112925366另外還有一種判斷的方法,以下為一個實例:
Procedure TBasDM.LoginServer;
var tempIni: TIniFile;
tmpServerFrm: TServerFrm;
i:Integer;
tmpList:TStringList;
IsAliasName:Boolean;
begin IsAliasName:=false;
tmpList:= TStringList.Create;
try
Session.GetAliasNames(tmpList);
for I := 0 to tmpList.Count - 1 do
if tmpList[i]='CostingDB' then
IsAliasName:=true; if not IsAliasName then
Session.AddAlias('CostingDB','MSSQL',CostDB.Params);
finally
tmpList.Free;
end; ......end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货