try
{CString strSqlCommand;
CString find;
find=m_findphone_num;
strSqlCommand = "SELECT * FROM 模块局账目表 where phone='" + find+"'";
m_pURLRecordset = m_pURLCon->Execute(strSqlCommand.AllocSysString(), NULL,adOpenUnspecified);}
catch
{
  //什么也不做
}

解决方案 »

  1.   

    同意:yarshray(saga jion) 
    一定要trytry
    {}
    catch ( _com_error &e )
    {
        _bstr_t bstrSoure ( e.Source () ) ;
        _bstr_t bstrDescription (e.Description () ) ;
       TRACE ( ( const char*)( bstrSource + "\n" + bstrDescription + "\n" ) ) ;
    }
    catch ( ... )
    {
       TRACE ( "出错\n" ) ;
    }
      

  2.   

    可程序会继续运行,又读取m_pURLRecordset 中的记录,此时并没有查询记录
    我该怎么写代码,是程序返回到开始,让用户重新输入条件。关键我不知道如何设标记,判断。