What does HRESULT 0x00040934 (IDS_MON_ORDINAL_OUT_OF_RANGE) mean?

 
Previous Next
IDS_MON_SEMI_COLON IDS_MON_VIEW_NOT_DEFINED

IDS_MON_ORDINAL_OUT_OF_RANGE

IDS_MON_ORDINAL_OUT_OF_RANGE is specific to positional ordering. Windows Search allows an ORDER BY column specifier to refer to a selected column by its one-based position, so the valid range changes whenever the SELECT list changes.

Compare the ordinal with the final projection

  • Count columns in the emitted SELECT list after optional fields have been added or removed.
  • Remember that the first selected column is ordinal 1, not 0.
  • Prefer a property name in generated ORDER BY clauses when the projection is dynamic and positional stability is not guaranteed.

The Windows Search ORDER BY contract explicitly supports ordinal references and defines the first query column as number 1. A stale ordinal can therefore appear after a harmless-looking UI change that hides one selected property. The index contents are irrelevant to this error because the parser can validate the ordinal against the query projection before sorting any rows.

ORDER BY clause · SELECT statement · Parser messages


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