ADOConnection1->ConnectionString.IsEmpty();
ADOConnection1->ConnectionString=ConnectPath("master"
;
try
{
//打开数据库
ADOConnection1->Open();
TIniFile *pIniFile = new TIniFile(FilePath+"//Server.ini"
;
pIniFile->WriteString("loy","connect","0"
;
delete pIniFile;
}
//打开失败
catch(Exception &e)
{
TIniFile *pIniFile = new TIniFile(FilePath+"//Server.ini"
;
pIniFile->WriteString("loy","connect","1"
;
delete pIniFile;
String aa="无法与服务器连接,可能有以下原因:";
aa=aa+"
/n(1)服务器没有开机";
aa=aa+"
/n(2)服务器的SQL Server2000没有启动";
aa=aa+"
/n如果不是以上两种情况,请与软件供应商联系。";
Application->MessageBox(aa.c_str(),"提示",MB_ICONQUESTION+MB_OK);
}