Unhandled exception in AddressBook.exe(KERNEL32.DLL):0xE06D7363void CAddressBookDlg::OnDelButton() 
{
// TODO: Add your control notification handler code here
UpdateData(true);
POSITION pos;
int m_pos;
pos = m_ListCtrl.GetFirstSelectedItemPosition();
if(!pos)
{
::MessageBox(NULL,"请选择你要删除的记录!","删除",MB_OK | MB_ICONWARNING);
return;
}
if(IDNO==::MessageBox(NULL,"确定要删除吗?","请谨慎操作!",MB_ICONWARNING | MB_YESNO))
return;
    m_pos = m_ListCtrl.GetNextSelectedItem(pos);
CString m_name,m_phone;
m_name = m_ListCtrl.GetItemText(m_pos,0);
m_phone = m_ListCtrl.GetItemText(m_pos,3);
if(ADOconnect())
{
try
{
CString strSQL;
strSQL.Format("select * from student where Name = '%s' and Phone = '%s'",m_name,m_phone);
m_recordset.CreateInstance("ADODB.Recordset");
m_recordset->Open((_variant_t)strSQL,
_variant_t((IDispatch *)ADOconnection.m_pConn,true),
adOpenStatic,
adLockOptimistic,
adCmdText
);
m_recordset = ADOconnection.m_pConn->Execute(_bstr_t(strSQL),NULL,adCmdText);
m_recordset->Delete(adAffectCurrent);
m_recordset->Update();
}
catch (_com_error &e)
{
AfxMessageBox(e.ErrorMessage());
return;
}
if(m_recordset->State)
m_recordset->Close();
}
}
删除数据库记录的代码,请赐教!