====关于ado一个问题======
//打开游标记录
BOOL CMemberView::ado_OpenCurRecordset(CString strTableName)
{
if(!m_fConnected) return FALSE;
if(strTableName.IsEmpty()) return FALSE;
AfxMessageBox("11");
//-------------------------------------------------------
HRESULT hr;
CString strQuery;
strQuery.Format("select * from %s", strTableName);
_bstr_t query = strQuery;
_bstr_t source = m_strSource;
AfxMessageBox("12");
try
{
hr = m_recordset->Open(query, source, adOpenDynamic, adLockOptimistic, adCmdText);
AfxMessageBox("13");
}
catch (_com_error &e)
{
MessageBox(e.ErrorMessage());
return FALSE;
}
//*/
AfxMessageBox("14");
return (SUCCEEDED(hr));
}
运行到m_recordset->Open处出错,如下
IDispatch #error 3149