通过ADO连接SQL Server,然后使用Recordset对数据表进行删除操作时出现如下异常
CString str_sql;
str_sql="Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Student;Data Source=SEVER\\SQLEXPRESS";    
hr = m_pConnection->Open(_bstr_t(str_sql),"","",adModeUnknown); m_pRecordset.CreateInstance(__uuidof(Recordset));;
m_pRecordset->CursorLocation = adUseClient;
m_pRecordset->CursorType = adOpenStatic;
m_pRecordset->LockType  = adLockOptimistic;CString str_tmp = "Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Student;Data Source=SEVER\\SQLEXPRESS";
m_pRecordset->Open("SELECT * FROM dbo.student",_variant_t((IDispatch*) m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText);运行m_pRecordset->Delete(adAffectCurrent)时,出现异常“Microsoft C++ exception: _com_error at memory location 0x0012f0a0”通过如下代码检查
bool bCheck = false;
bCheck = m_pRecordset->Supports((enum CursorOptionEnum)adDelete);
以上的链接支持删除操作。请问如何出现上述情况呢?