ADO 如何操作存储过程

liyuncdc 2007-06-30 09:35:05

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连接吗?
...全文
156 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
youngwolf 2007-07-01
  • 打赏
  • 举报
回复
m_pCommand.CreateInstance(...);
m_pCommand->CommandText=...;

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧