我采用的办法如下,其中str_connect是从文本中读入的链接字符串。如果连接不上的话程序中执行adoconnection1.ConnectionString := str_connect;这一句比较耗费时间,有没更快一点的解决办法啊?
adoconnection1.ConnectionString := str_connect;
try
adoconnection1.Connected := true;
except
if MessageDlg('数据库连接出错',mtError,[mbYes],22) = mrYes then;
ExitProcess(0);
end;
adoconnection1.ConnectionString := str_connect;
try
adoconnection1.Connected := true;
except
if MessageDlg('数据库连接出错',mtError,[mbYes],22) = mrYes then;
ExitProcess(0);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货