What does HRESULT 0x80040E60 (DB_E_CANTORDER) mean?

 
Previous Next
DB_E_CANTFILTER MD_E_BADTUPLE

DB_E_CANTORDER

Meaning

Windows documents DB_E_CANTORDER as “Order cannot be opened”. In this case, the provider cannot open the requested sort order for the current view.

Relevant contract

OLE DB view interfaces apply filter and sort definitions to a source rowset. Opening a filter or order depends on the view object, criteria metadata, rowset capabilities and current source state, not merely on the text of a predicate or sort key.

Investigation of this result should start with the IRowsetView-derived object, source rowset generation and filter or sort definition being opened.

Evidence to collect

When recording diagnostic data involving filter values, sort keys and row identities, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.

  • Evidence 1: ordered column DBIDs and direction flags.
  • Evidence 2: current source metadata and rowset properties.
  • Evidence 3: provider diagnostics from the sort-open stage.

Conditions that specifically lead to it

  • Cause 1: a sort key is unavailable or not orderable.
  • Cause 2: the provider does not support the requested multi-column order.
  • Cause 3: source rowset changes invalidated the stored sort definition.

Diagnostic sequence

  1. Identify the exact failing stage: the provider cannot open the requested sort order for the current view.

Retry and recovery

Retry rule: retry after replacing the order with one supported by the current source.

Corrective actions

  • Action 1: remove unsupported keys or directions.
  • Action 2: rebuild the order from current column metadata.
  • Action 3: push ordering into the command only when collation and null ordering remain correct.

Practical scenario

A view attempts to sort an object-valued column; selecting a scalar key prevents it.

Difference from nearby HRESULT values

DB_E_CANTFILTER concerns a predicate view, while DB_E_CANTORDER concerns creation of an ordered view.

Official Microsoft references


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