procedure TForm1.FormShow(Sender: TObject);
var
Ls:Tstringlist;
i:integer;
ss,masteruser,sa,dbservername:string;begin Ls:=Tstringlist.Create;
 Ls.LoadFromFile(appPath+'property.txt');
 for i:=0 to 3 do begin
     ss:=ls.Strings[i];
     if i=0 then sysdb:=trim(copy(ss,pos('=',ss)+1,100));
     if i=1 then masteruser:=trim(copy(ss,pos('=',ss)+1,100));
     if i=2 then sa:=trim(copy(ss,pos('=',ss)+1,100));
     if i=3 then dbservername:=trim(copy(ss,pos('=',ss)+1,100));
 end; if sa<>'' then
 sdbconn:='SQLOLEDB.1;Password='+sa+';Persist Security Info=True;User ID='+masteruser+';Initial Catalog='+sysdb+';Data Source='+dbservername
 else
 sdbconn:='SQLOLEDB.1;Persist Security Info=True;User ID='+masteruser+';Initial Catalog='+sysdb+';Data Source='+dbservername;
 ls.Free; ADOConnection1.Close;
 ADOConnection1.ConnectionString:=sdbconn;
 try
  
   ADOConnection1.Open();
 except
   showmessage('连接数据库失败');
exit;
end;
 end;