m_pRs->Index="FORM_ID,FIELD_ID";
m_pRs->Open("select FORM_ID,FIELD_ID,INPUT_TYPE from dbo.T_FRM_FORMFIELD(index(IX_T_FRM_FORMFIELD))\
   where form_id in (select form_id from t_app_case)\
   order by FORM_ID,INPUT_TYPE,FIELD_ID"
   ,_variant_t((IDispatch *)m_pConn,true)//,adOpenStatic, adLockReadOnly, adCmdText);
   ,adOpenDynamic// ,adOpenKeyset
   ,adLockOptimistic
   ,adCmdText);
在这里补报错
但使用
m_pRs->Seek(
时报错

解决方案 »

  1.   

    就是说你用的OLE DB Provider不支持Seek
    调用Supports(adSeek) 检查一下
      

  2.   

    我用的是sql server 2000不可能不支持呀
    strcpy(g_sConnString,"Provider=SQLOLEDB;Data Source=DBSVR;Initial Catalog=TESTCMB;User ID=sa; PWD=");
    用Supports(adSeek)检查告知不支持,原因不知,我昨天上午都可以支持下午突然间被告知不支持,高手请告知原因,
    我在数据库表T_FRM_FORMFIELD中一件索引IX_T_FRM_FORMFIELD但不知为什么会这样。
      

  3.   

    Seek的限制比较多
    This method is supported only with server-side cursors. Seek is not supported when the Recordset object's CursorLocation property value is adUseClient.This method can only be used when the Recordset object has been opened with a CommandTypeEnum value of adCmdTableDirect.
      

  4.   

    can you give me a example ?
    thank you very much!
    I have lookup msdn get a example about it ,but I can not use seek yet.
      

  5.   

    个人认为SEEK的限制使得它并不实用
    试试
    m_pRs->CursorLocation = adUseServer;
    m_pRs->Open("your_table_name",_variant_t((IDispatch *)pConn,true), adOpenStatic, adLockReadOnly, adCmdTableDirect);