m_pRecordset->GetFields()->GetItem("img") 后的方法都提示出错~~例如:
  m_pRecordset->GetFields()->GetItem("img")->ActualSize;
  m_pRecordset->GetFields()->GetItem("img")->Attributes;
m_pRecordset->GetFields()->GetItem("img")->AppendChunk(varBLOB);都有错误啊, 在这个问题上卡了好几天了, 那位高手给指点一下啊~~之前的部分主要程序如下:m_pConnection.CreateInstance(__uuidof(Connection));
m_pConnection->Open("Provider=MSDASQL.1;Persist Security Info=False;Data Source=Visual FoxPro Database","","",adModeUnknown);
m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->Open(bstrSQL,m_pConnection.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);
CString sql;
sql.Format("select* from Member2 where id = '%s'",m_Number);
m_pRecordset=m_AdoConn.GetRecordSet((_bstr_t)sql);

解决方案 »

  1.   

    m_pRecordset打开两次,检测一下打开的状态,如不成功的话,不能进行后继操作。
      

  2.   

    m_pRecordset 是否成功了,指针是否正确,GetItem()返回的指针是否正确
      

  3.   

    m_pRecordset=m_AdoConn.GetRecordSet((_bstr_t)sql);这个出问题了吧.看看GetItem()返回的指针是否有值,用m_pRecordSet->GetCollect("ss")得到字段的值
      

  4.   

    先谢谢各位了, 这个问题
     m_pRecordset->GetFields()->GetItem("img")->ActualSize;
    已经解决了, 但是
    m_pRecordset->GetFields()->GetItem("img")->AppendChunk(varBLOB);
    还是出问题啊~~大家给出处主意啊~~谢谢了~~