4,011
社区成员
发帖
与我相关
我的任务
分享
try
{
m_pRecordset->Open(_variant_t (strSql),
m_pConnection.GetInterfacePtr(), //// 也可以用_variant_t((IDispatch *)m_pConnection,true),
adOpenDynamic,
adLockOptimistic,
adCmdText) ;
while(!m_pRecordset->adoEOF)
{
……
m_pRecordset->MoveNext();
nCount++;
}
}
catch(_com_error err)
{
CString errMsg;
errMsg.Format("查询记录失败:%s,%s",err.ErrorMessage(),err.Description()););
AfxMessageBox(errMsg);
}