What does HRESULT 20498 (S_ADS_NOMORE_ROWS) mean?

 
Previous Next
S_ADS_ERRORSOCCURRED S_ADS_NOMORE_COLUMNS

S_ADS_NOMORE_ROWS

S_ADS_NOMORE_ROWS is the normal end marker for IDirectorySearch row enumeration. It is returned after the current search handle has no additional result row; it does not by itself indicate that the query failed or that the directory was unreachable.

Treat it as a loop terminator, not a search failure

  • Keep the ADS_SEARCH_HANDLE associated with one ExecuteSearch call and advance it with GetFirstRow/GetNextRow.
  • Count rows separately from the terminal HRESULT so an empty result set and an enumeration error are distinguishable in logs.
  • Close the search handle after enumeration; do not retry the same row call indefinitely when this status is reached.

The IDirectorySearch documentation explicitly uses this status as the end condition for row iteration. Compare it with S_ADS_ERRORSOCCURRED, which can signal partial result problems. If application code converts every non-S_OK value into an exception, it will misclassify a normal completed search. The useful diagnostics are the filter, requested attributes, search scope, and final row count—not a generic directory-service failure message.

Searching with IDirectorySearch · Generic ADSI statuses


Looking for a different code? Search another status or error code.