4,012
社区成员
发帖
与我相关
我的任务
分享
try{
sql.Format("select * from PCBAProductList where SN_STR <= '%s' and SN_END >= '%s' and Enable = '1'",m_sninput,m_sninput);
//没有找到记录
m_pRst=m_pConnection->Execute((_bstr_t)sql,NULL,adCmdText);
//我的理解是直接回判断到adoEOF 是ture,但是这里直接跳到了catcn,抛出了异常
if(m_pRst->adoEOF == TRUE)
{
m_error_code = "Can not find this SN in table!";
return FALSE;
}
}
catch(_com_error e)
{
CString errmessage = _T("");
char* buf = _com_util::ConvertBSTRToString(e.Description());
errmessage.Format(_T("Warning: exception desception:%s | errmessage:%s"),buf,e.ErrorMessage());
m_error_code = errmessage;
return FALSE;
}
if(m_pRst->adoEOF == TRUE)//
{
m_error_code = "Can not find this SN in table!";
return FALSE;
}