var Servername, DataBaseName, UserId, Cstring, ErrorStr: string;
begin
Mis_Reg.OpenKey(Database_Reg, False);
{ ServerName := Mis_Reg.ReadString('ServerName');
DataBaseName := Mis_Reg.ReadString('DataBase');
UserId := Mis_Reg.ReadString('User');
Cstring := 'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=' + UserId +
';Initial Catalog=' + DatabaseName + ';Data Source=' + ServerName +
';Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;' +
'Workstation ID=MIS01;Use Encryption for Data=False;' +
'Tag with column collation when possible=False';
Main_Adoc1.ConnectionString := Cstring;
try
Main_Adoc1.Open;
except
begin
MessageBox(Application.handle, '数据库连接失败!', Sys_msg, MB_OK + MB_ICONSTOP);
Application.Terminate;
end;
end;
}