打开记录集出现问题
我在打开记录集中出现这样的错误
error C2065: 'm_pRecordset' : undeclared identifier
这是怎么回事?
代码如下
COMCApp*pApp=(COMCApp*)AfxGetApp();
m_pRecordset.CreateInstance(__uuidof(Recordset));
try
{
recPtr->Open(strSQL.AllocSysString(),
pApp->m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic;
adCmdText);
}
catch (_com_error e)
{
CString strError;
strError.Format("警告:打开数据表时发生异常。错误信息:%s",\
e.ErrorMessage());
AfxMessageBox(strError);
return FALSE;
}
return TRUE;