procedure TData1.DataModuleCreate(Sender: TObject);
var filename:string;
begin
  try
filename:=ExtractFilePath(paramstr(0))+'myini.ini';
myinifile:=TInifile.Create(filename);
ADOConnection1.ConnectionString:= 'Provider=SQLOLEDB.1;Password='+myinifile.readstring('ServerInfo','SQLPwd','')+';Persist Security Info=True;User ID='+myinifile.readstring('ServerInfo','SQLUserID','')+';Initial Catalog='+myinifile.readstring('ServerInfo','SQLDBName','')+';Data Source='+myinifile.readstring ('ServerInfo','ServerIP','');
except
Application.MessageBox('连接数据库失败','提示');
end;
end;
myinifile数据源正确当然可以进入,但是如果错了也不会Application.MessageBox('连接数据库失败','提示');而是一种死机状态,为什么,可以改不