为什么一读就报错呢?
if(!pRecordset->adoBOF)
   pRecordset->MoveFirst();
   else  {
   MessageBox("表内无数据");
   }
  while(!pRecordset->adoEOF)
   {
   var=pRecordset->GetCollect("DC");
   if(var.vt!=VT_NULL)
   DC1=(LPCSTR)_bstr_t(var);
   m_DIS.SetWindowText(DC1);

解决方案 »

  1.   

    m_DIS.SetWindowText(DC1);注释掉这一句就可以了是不是类型不一样呀
    报的是DEBUG ASSERTION FAILED
      

  2.   

    if(!pRs->adoEOF)
    {
    _vValue=pRs->GetCollect("title");
    if(_vValue.vt!=VT_NULL)
    {
    _vValue.ChangeType(VT_BSTR);
    strTitle=_vValue.bstrVal;
    } _vValue=pRs->GetCollect("Content");
    if(_vValue.vt!=VT_NULL)
    {
    _vValue.ChangeType(VT_BSTR);
    strContent=_vValue.bstrVal;
    } _vValue=pRs->GetCollect("Description");
    if(_vValue.vt!=VT_NULL)
    {
    _vValue.ChangeType(VT_BSTR);
    strDesc=_vValue.bstrVal;
    } pRs->Close();
    }//end if