OLEDB SDK 中怎麼使用IRowsetFind::FindNextRow()? void * pFindValue,參數怎麼寫?HRESULT FindNextRow (
   HCHAPTER            hChapter,章節句柄,沒有章節的行集為空
   HACCESSOR           hAccessor,行集訪問器句柄
   void *              pFindValue,                            ???
   DBCOMPAREOP         CompareOp,比較方式
   ULONG               cbBook,書簽值的存儲長度
   const BYTE *        pBook,書簽的(值)地址
   LONG                lRowsOffset,要跳過多少行才開始取
   LONG                cRows,想要返回的行數
   ULONG *             pcRowsObtained,實際返回的行數
   HROW **             prghRows);返回行句柄從一個位置(用書簽來標識位置)開始找 (pFindValue)                                 
                                 謝謝 !!!

解决方案 »

  1.   

    oledb sdk 中怎麼樣才能正確取得 'IRowsetFind' 接口 ??? 我用以下代碼
    'pICommandProperties->SetProperties(1,rgInitPropSet);' 返回錯誤代碼 'DB_S_ERRORSOCCURRED' 所以 'pIRowset->QueryInterface(IID_IRowsetFind,(void **)&pIRowsetFind);' 返回失敗!請問要這個接口要設置什么才能正確取得 ?
    'IRowsetFind->FindNextRow()'怎麼使用 ? InitProperties[0].dwPropertyID=DBPROP_IRowsetScroll;
    InitProperties[0].dwOptions=DBPROPOPTIONS_REQUIRED;
    InitProperties[0].dwStatus=DBPROPSTATUS_OK;
    InitProperties[0].colid=DB_NULLID;
    InitProperties[0].vValue.vt=VT_BOOL;
    InitProperties[0].vValue.lVal=VARIANT_TRUE; InitProperties[1].dwPropertyID=DBPROP_IRowsetFind;
    InitProperties[1].dwOptions=DBPROPOPTIONS_REQUIRED;
    InitProperties[1].dwStatus=DBPROPSTATUS_OK;
    InitProperties[1].colid=DB_NULLID;
    InitProperties[1].vValue.vt=VT_BOOL;
    InitProperties[1].vValue.lVal=VARIANT_TRUE; rgInitPropSet[0].cProperties=2;
    rgInitPropSet[0].guidPropertySet=DBPROPSET_ROWSET;
    rgInitPropSet[0].rgProperties=InitProperties; hr=pICommandText->QueryInterface(IID_ICommandProperties,(void **)&pICommandProperties); hr=pICommandProperties->SetProperties(1,rgInitPropSet);
    if (DB_S_ERRORSOCCURRED==pICommandProperties->SetProperties(1,rgInitPropSet))
    cout<< "test";
    if(FAILED(hr))
    {
    cout<< "OLEDB Error !\r\nExecute Failed To Set Rowset Properties";
    }
        hr = pIRowset->QueryInterface(IID_IRowsetFind,(void **)&pIRowsetFind);
        if(FAILED(hr))
        {
    cout << "Failed to get IID_IRowsetFind interface.\n";
    cout << endl;
        } //end if
      

  2.   

    lihao_ningxia(耗子) :請問要這個接口要設置什么才能正確取得 ?