ACCESSS数据库更新问题
代码如下:
但是走到Update()时出错,请哪位高手解答一下,谢谢
try
{
m_pAccBaseRecordset->AddNew();
m_pAccBaseRecordset->PutCollect("字段名1", _variant_t(CString类型数据1));
m_pAccBaseRecordset->PutCollect("字段名2", _variant_t(CString类型数据2));
m_pAccBaseRecordset->PutCollect("字段名3", _variant_t(CString类型数据3));
m_pAccBaseRecordset->PutCollect("字段名4", _variant_t(CString类型数据4));
m_pAccBaseRecordset->PutCollect("字段名5", _variant_t(CString类型数据5));
m_pAccBaseRecordset->PutCollect("字段名6", _variant_t(CString类型数据6));
m_pAccBaseRecordset->PutCollect("字段名7", _variant_t(CString类型数据7));
m_pAccBaseRecordset->PutCollect("字段名8", _variant_t(CString类型数据8));
m_pAccBaseRecordset->PutCollect("字段名9", _variant_t(CString类型数据9));
m_pAccBaseRecordset->Update();
}
catch(_com_error *e)//错误判断
{
AfxMessageBox(e->ErrorMessage());
}