Export (0) Print
Expand All

IDirectorySearch::GetPreviousRow method

The IDirectorySearch::GetPreviousRow method gets the previous row of the search result. If the provider does not provide cursor support, it should return E_NOTIMPL.

Syntax


HRESULT GetPreviousRow(
  [in]  ADS_SEARCH_HANDLE hSearchHandle
);

Parameters

hSearchHandle [in]

Provides a handle to the search context.

Return value

This method returns the standard return values, as well as the following:

For other return values, see ADSI Error Codes.

Return codeDescription
S_OK

The previous row was successfully obtained.

E_NOTIMPL

The provider does not provide the cursor support for search.

 

Remarks

When the ADS_SEARCHPREF_CACHE_RESULTS flag is not set, only forward scrolling is permitted, because the client might not cache all the query results.

Examples


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);
}

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Iads.h

DLL

Activeds.dll;
Adsldp.dll;
Adsldpc.dll

IID

IID_IDirectorySearch is defined as 109BA8EC-92F0-11D0-A790-00C04FD8D5A8

See also

IDirectorySearch
ADSI Error Codes

 

 

Show:
© 2014 Microsoft