Q
qianwt
Unregistered / Unconfirmed
GUEST, unregistred user!
不完整,还少函数,不过是这样的思路
ServerName := Ini.ReadString('DBCONFIG', 'SERVERNAME', '.');
DataBaseName := Ini.ReadString('DBCONFIG', 'DATABASENAME', 'wkgxl');
UID := Ini.ReadString('DBCONFIG', 'USERNAME', 'sa');
PWD := Ini.ReadString('DBCONFIG', 'PASSWORD', '[]');
PWD := Copy(Pwd, 2, length(Pwd) - 2);
PWD := GetPass(PChar(PWD));
ConnectionString := 'Provider=SQLOLEDB.1;Persist Security Info=True;'
+ 'Data Source=' + ServerName + ';'
+ 'Initial Catalog=' + DataBaseName + ';'
+ 'User ID=' + UID + ';'
+ 'Password=' + PWD + ';';
Conn.ConnectionString := ConnectionString;
ServerName := Ini.ReadString('DBCONFIG', 'SERVERNAME', '.');
DataBaseName := Ini.ReadString('DBCONFIG', 'DATABASENAME', 'wkgxl');
UID := Ini.ReadString('DBCONFIG', 'USERNAME', 'sa');
PWD := Ini.ReadString('DBCONFIG', 'PASSWORD', '[]');
PWD := Copy(Pwd, 2, length(Pwd) - 2);
PWD := GetPass(PChar(PWD));
ConnectionString := 'Provider=SQLOLEDB.1;Persist Security Info=True;'
+ 'Data Source=' + ServerName + ';'
+ 'Initial Catalog=' + DataBaseName + ';'
+ 'User ID=' + UID + ';'
+ 'Password=' + PWD + ';';
Conn.ConnectionString := ConnectionString;