hr=theApp.m_pConnect.CreateInstance("ADODB.Connection");
sprintf(buf,"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Password;Data Source=%s",m_sServer);
if(SUCCEEDED(hr))
{
hr=theApp.m_pConnect->Open(buf,"","",-1); }
m_pRecordset.CreateInstance("ADODB.Recordset");
sprintf(buf,"select * from psw where like \'%s\'",m_sUser);
m_pRecordset->Open(_variant_t(buf),theApp.m_pConnect.GetInterfacePtr(),adOpenStatic,adLockOptimistic,adCmdText);
我需要通过m_sServer的值检索出表中其他的记录值,哪里写错了吗?执行不了?
还有其他的方法吗?
sprintf(buf,"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Password;Data Source=%s",m_sServer);
if(SUCCEEDED(hr))
{
hr=theApp.m_pConnect->Open(buf,"","",-1); }
m_pRecordset.CreateInstance("ADODB.Recordset");
sprintf(buf,"select * from psw where like \'%s\'",m_sUser);
m_pRecordset->Open(_variant_t(buf),theApp.m_pConnect.GetInterfacePtr(),adOpenStatic,adLockOptimistic,adCmdText);
我需要通过m_sServer的值检索出表中其他的记录值,哪里写错了吗?执行不了?
还有其他的方法吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货