积极答复者
Recordset中的MoveNext()问题

问题
-
在VS2008中用ADO访问ACCESS,对数据库进行查询,但是用记录集移向下一行的时候总是弹出运行时中断。调试过程中发现时只要进入Recordset中的MOVENEXT()就发生异常。弹出的对话框说是内存中未处理的异常,指向_com_error。然后就指向这段代码
inline HRESULT Recordset15::Close ( ) {
HRESULT _hr = raw_Close();
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _hr;
}
我不知道这里有什么错误,请高手帮忙。
答案
-
-
-
你要是不直接调用raw_Close()这个C函数,那么你就需要把Recordset15::Close()的调用放到try...catch中,因为_com_issue_errorex(_hr, this, __uuidof(this));会用throw抛出异常,你若没有catch就会报错
0xBAADF00D- 已标记为答案 VisualElevenModerator 2011年3月31日 5:01
全部回复
-
-
-
你要是不直接调用raw_Close()这个C函数,那么你就需要把Recordset15::Close()的调用放到try...catch中,因为_com_issue_errorex(_hr, this, __uuidof(this));会用throw抛出异常,你若没有catch就会报错
0xBAADF00D- 已标记为答案 VisualElevenModerator 2011年3月31日 5:01