m_pConnection 的类型是_ConnectionPtr_CommandPtr m_pCommand;
m_pCommand->ActiveConnection=m_pConnection;
m_pCommand->CommandType=adCmdStoredProc;
_RecordsetPtr pRstByRoyalty;
pRstByRoyalty = m_pCommand->Execute( NULL,NULL,adCmdStoredProc);
while(!pRstByRoyalty->adoEOF){
vt_id = m_pRecordset->GetCollect("truck_id");
if(vt_id.vt!=VT_NULL)
str = (LPCTSTR)(_bstr_t)vt_id;
m_pRecordset->MoveNext();
}可是在调试的时候m_pCommand->ActiveConnection=m_pConnection这一句就出错了!
难道 这样不可以使用ADO连接吗?