谢谢,谢谢,非常感谢
m_recordset->AddNew();
m_recordset->PutCollect("China_Char",tmp);
m_recordset->PutCollect("Rec_Num",_variant_t((long)(Final_Rec_Num)));
m_recordset->PutCollect("Char_Num",_variant_t((long)(Final_Charactor)));
m_recordset->Update ();
这个会有问题吗?
是Update只能用一次吗?〉?

解决方案 »

  1.   

    我想可能是记录的指针没有移动的原因吧
    加两行试一下if(!m_recordset->adoEOF)
      m_recordset->MoveLast();m_recordset->AddNew();
    ……
      

  2.   

    为什么不用SQL?
    _CommandPtr pCmd;
    pCmd.create....
    _bstr_t SQL = "insert into table....."
    pCmd->ActiveConnection = pCon;
    pCmd->CommandText = SQL;
    pCmd->Excute(NULL, NULL, adCmdText);
    这样不会有问题吧
      

  3.   

    ::CoInitialize(NULL);
    m_pConnection.CreateInstance(_uuidof(Connection));
    m_pRecordset.CreateInstance(_uuidof(Recordset));
    try
    {
       ……
    m_pRecordset->Close();
    m_pConnection->Close();
    }
    catch(_com_error *e)
    {
    AfxMessageBox(e->ErrorMessage());
    }
    m_pConnection=NULL;
    m_pRecordset=NULL;
    ::CoUninitialize();
    中间加上自己的代码就可以了~~