有如下一个函数:
void Test()
{
_bstr_t strSql;
strSql = "select * from text";
HRESULT hr = m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->Open(strSql, m_pConnection.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);  while(!m_pRecordset->adoEOF)
{
variant_t ret = m_pRecordset->GetCollect("text1");
int i = ret.lVal;
cout<<i <<endl;
m_pRecordset->MoveNext();
}
}
调试时报:
mysql_test.exe 中的 0x7c812aeb 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0012f930 处的 _com_error。
mysql_test.exe 中的 0x7c812aeb 处未处理的异常: Microsoft C++ 异常: 内存位置 0x0012f930 处的 _com_error。
我看了一天,每当调用到m_pRecordset的时候,msado15.tli这个文件就会显示出来,并且提示return _hr处有错,例如:
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);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
->  return _hr;
}
我实在是找不到问题在什么地方,才来请教各位,希望您不吝赐教。