我用如下查询语句
 strSQL="select * from µØ¿éÖÖÖ²±í where Å©»§±àºÅ=";
    strSQL+=pDoc->m_strFarmerNum;
    CNewPlotDoc *pPlotDoc=new CNewPlotDoc(strSQL);    m_DataGrid2.SetRefDataSource((LPUNKNOWN)pPlotDoc->pRs);
    m_DataGrid2.Refresh();查询完后得到set绑定控件是出现提示:
The rowset is not bookable
我如果用这样的语句就没有问题   
select * from µØ¿éÖÖÖ²±í
为什么??

解决方案 »

  1.   

    m_pRecordset.CreateInstance("ADODB.Recordset");
          m_pRecordset->CursorLocation=adUseClient;
      m_pRecordset->Open((LPCSTR)TempSqlText,m_pConnection.GetInterfacePtr(), adOpenKeyset,adLockOptimistic,adCmdText);
      }
      catch(_com_error e)
      {
         m_pRecordset->Close();
     AfxMessageBox("Connect Server failed!please Connect again!");
         return;
      }
        m_DataGrid.putref_DataSource((LPUNKNOWN)m_pRecordset.Detach());
    m_DataGrid.Refresh();
    }请注意RecordSet的游标之类的...
      

  2.   

    我的m_DataGrid没有putref_DataSource方法呀
      

  3.   

    我试过了,还是不行,怎样才能得到支持书签的RecordSet呢
      

  4.   

    adOpenKeyset和adOpenStatic打开的Recordset都支持BookMark。可以用RecordSet->Supports(adBook)来判断一下RecordSet是否支持BookMark。