请教各位高手: int num;
m_pRecordset.CreateInstance(__uuidof(Recordset));
CString strSql;
strSql.Format("select count(*) form xxx where id=1 );
BSTR bstrSQL=strSql.AllocSysString();
m_pRecordset->Open(bstrSQL,(IDispatch *)m_pConnection,adOpenStatic,adLockOptimistic,adCmdText);
现在想把查询到的数赋给变量 num,请问这个怎么实现啊?
m_pRecordset.CreateInstance(__uuidof(Recordset));
CString strSql;
strSql.Format("select count(*) form xxx where id=1 );
BSTR bstrSQL=strSql.AllocSysString();
m_pRecordset->Open(bstrSQL,(IDispatch *)m_pConnection,adOpenStatic,adLockOptimistic,adCmdText);
现在想把查询到的数赋给变量 num,请问这个怎么实现啊?
m_pRecordset->Open(bstrSQL,(IDispatch *)m_pConnection,adOpenStatic,adLockOptimistic,adCmdText);num= m_pRecordset->GetCollect("STATUS");这里这个STATUS是你的字段名