VAR
CN : TADOConnection;
CNE : TADOQUERY;
BEGIN cn:=TADOConnection.Create(nil);
//建立与服务器的连接 CNE:=TADOQUERY.Create(nil);
//建立数据库查询 cn.Provider:=Provider_str;
cn.CommandTimeout:=C_timeout;
cn.LoginPrompt:=false;
cn.ConnectionString:='Server='+Svr_NAME+';Database='+Database+';'; //Security是身份验证,如果为TRUE,则仅利用WINDOWS验证
//如果为FALSE,则利用WINDOWS和SQL SERVER的双重验证 if Security then
cn.Properties.Item['Integrated Security'].value:= 'SSPI'
Else
begin
cn.Properties.item['User ID'].Value:= Username;
cn.Properties.item['Password'].Value:= Password;
end;
CNE.Connection:=cn;
CN : TADOConnection;
CNE : TADOQUERY;
BEGIN cn:=TADOConnection.Create(nil);
//建立与服务器的连接 CNE:=TADOQUERY.Create(nil);
//建立数据库查询 cn.Provider:=Provider_str;
cn.CommandTimeout:=C_timeout;
cn.LoginPrompt:=false;
cn.ConnectionString:='Server='+Svr_NAME+';Database='+Database+';'; //Security是身份验证,如果为TRUE,则仅利用WINDOWS验证
//如果为FALSE,则利用WINDOWS和SQL SERVER的双重验证 if Security then
cn.Properties.Item['Integrated Security'].value:= 'SSPI'
Else
begin
cn.Properties.item['User ID'].Value:= Username;
cn.Properties.item['Password'].Value:= Password;
end;
CNE.Connection:=cn;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货