Share via


IDirectorySearch::GetPreviousRow 方法 (iads.h)

IDirectorySearch::GetPreviousRow 方法會取得搜尋結果的前一個數據列。 如果提供者未提供數據指標支援,它應該會傳回 E_NOTIMPL

語法

HRESULT GetPreviousRow(
  [in] ADS_SEARCH_HANDLE hSearchResult
);

參數

[in] hSearchResult

提供搜尋內容的句柄。

傳回值

此方法會傳回標準傳回值,以及下列各項:

如需其他傳回值,請參閱 ADSI 錯誤碼

備註

未設定 ADS_SEARCHPREF_CACHE_RESULTS 旗標時,只允許向前捲動,因為用戶端可能不會快取所有查詢結果。

範例

hr = m_pSearch->ExecuteSearch(L"(&(objectCategory=user)(st=WA))", pszAttr, dwCount, &hSearch );
if ( SUCCEEDED(hr) )
{
   while(  m_pSearch->GetNextRow(hSearch)  != S_ADS_NOMORE_ROWS )
   {
      /* Get the data */
   }
   // Print it backward
   hr = m_pSearch->GetPreviousRow( hSearch );
   while( hr != S_ADS_NOMORE_ROWS  &&  hr != E_NOTIMPL)
   {
      /* Get the data */
   }
   m_pSearch->CloseSearchHandle(hSearch);
}

規格需求

需求
最低支援的用戶端 Windows Vista
最低支援的伺服器 Windows Server 2008
目標平台 Windows
標頭 iads.h
Dll Activeds.dll;Adsldp.dll;Adsldpc.dll

另請參閱

ADSI 錯誤碼

IDirectorySearch