我也有类似的问题需要请教:用MFC进行数据库的一些操作处理。新手,真心求助!

ado.exe 中的 0x7c812afb 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0012efe0 处的 _com_error。
ado.exe 中的 0x7c812afb 处有未经处理的异常: Microsoft C++ 异常: 内存位置 0x0012efe0 处的 _com_error。
ado.exe 中的 0x004164f4 处最可能的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突
ado.exe 中的 0x004164f4 处有未经处理的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突
第一个中断:
Interface* operator->() const
{
if (m_pInterface == NULL) {
_com_issue_error(E_POINTER);
}
return m_pInterface; // 断点1出现在这
}
第2个中断:
inline HRESULT Recordset15::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType, long Options ) {
HRESULT _hr = raw_Open(Source, ActiveConnection, CursorType, LockType, Options);
//第2个断点

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _hr;
}
就这两个地方的问题,不明白是什么问题。望高手指教啊!

第1个回答  2012-08-10
inline _RecordsetPtr Connection15::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) {
struct _Recordset * _result = 0;
HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _RecordsetPtr(_result, false);
}
我的出现在这个函数,不知道该怎么处理本回答被网友采纳
第2个回答  2012-08-07
内存错误,这个不好说! 你调试运行,出错之后程序会停下,你看停在哪的,之后再看什么问题!追问

中断调试,会停在一个函数那,但我知道什么意思。我把那段代码贴出来,你帮看看?

Interface* operator->() const
{
if (m_pInterface == NULL) {
_com_issue_error(E_POINTER);
}
return m_pInterface; // 断点1出现在这
}

相似回答