runtime error!!
abnormal program termination

解决方案 »

  1.   

    m_pRecordset->Open("DELETE FROM DemoTable WHERE ID>0",// 清空DemoTable表中所有字段
    theApp.m_pConnection.GetInterfacePtr(),// 获取库接库的IDispatch指针
    adOpenStatic,
    adLockOptimistic,
    adCmdText);
      

  2.   

    这个SQL语句应该这样吧:DELETE * FROM DemoTable WHERE ID>0
      

  3.   

    CString strQuery;
    strQuery="select * from DemoTable where ID>";
    strQuery+="'";
    strQuery+="0";
    strQuery+="'";try
    {
    m_pRecordset->Open((_variant_t)strQuery,
        theApp.m_pConnection.GetInterfacePtr(),
        adOpenDynamic,
        adLockOptimistic,
        adCmdText);
    m_pFieldsPtr = m_pRecSet->Fields; while(!m_pRecordset->adoEOF)
    {
    m_pRecordset->Delete(adAffectCurrent);
    m_pRecordset->Update();
    m_pRecordset->MoveNext();
    }
    m_pRecordset->Close();
    }
    }
      

  4.   

    大家不好意思,我一个记录集调用 了两次Open()函数,所以会出现如此错误,已解决了。