34,587
社区成员
发帖
与我相关
我的任务
分享
_RecordsetPtr adoRst;
_variant_t vNull, vValue;
vNull.vt= VT_ERROR;
vNull.scode= DISP_E_PARAMNOTFOUND;
CString strSql = "select top 1 * from tb_FileTemplate where IsDeal = 0";
vValue = strSql;
try
{
adoRst.CreateInstance(__uuidof(Recordset) );
adoRst->putref_ActiveConnection(m_pConnection);
adoRst-> CursorLocation = adUseClient;
adoRst->Open(vValue, vNull, adOpenForwardOnly, adLockReadOnly, adCmdText);
.........
}
catch (_com_error &e)
{
CString strErrDescribe;
strErrDescribe.Format("Exception thrown for classes generated by #import"
"\tCode = %81x\n"
"\tCode meaning = %s\n"
"\tSource = %s\n"
"\tDescription = %s\n",
e.Error(),
e.ErrorMessage(),
(LPCTSTR)(e.Source()),
(LPCTSTR)(e.Description()));
TRACE("%s %s\r\n", (LPCTSTR)e.Source(),(LPCSTR)e.Description());
return -97;
}
catch(...)
{
//我想问下如果这儿出现异常了 怎么找导致该异常出现的原因呢? return -98;
}