What does HRESULT 0x80040E55 (DB_E_BADORDINAL) mean?

 
Previous Next
DB_E_MAXPENDCHANGESEXCEEDED DB_E_PENDINGCHANGES

DB_E_BADORDINAL

Meaning

Windows documents DB_E_BADORDINAL as “Column does not exist”. In this case, a binding or parameter operation references a numeric ordinal that is not present in the current metadata.

Relevant contract

OLE DB distinguishes numeric ordinals, DBID-based column identifiers and per-column status. Metadata from IColumnsInfo or a row object is authoritative for the current result shape; cached identifiers can become invalid after command, schema or projection changes.

Investigation of this result should start with the current command result, rowset or row object and the metadata generation from which the column reference came.

Conditions that specifically lead to the result

  • Cause 1: an ordinal is zero where only real columns are accepted.
  • Cause 2: the ordinal exceeds the current column or parameter count.
  • Cause 3: cached ordinals came from a different projection or command text.

Evidence to collect

When recording diagnostic data involving column names, row values and query projections, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.

  • Evidence 1: the rejected ordinal and method.
  • Evidence 2: current IColumnsInfo or parameter metadata.
  • Evidence 3: command or schema generation used to build the binding.

Diagnostic sequence

  1. Identify the exact failing stage: a binding or parameter operation references a numeric ordinal that is not present in the current metadata.

Corrective actions

  • Action 1: rebuild ordinal mappings from current metadata.
  • Action 2: distinguish bookmark ordinal zero from ordinary columns.
  • Action 3: invalidate bindings when the result shape changes.

Retry and recovery

Retry rule: retry after replacing the ordinal with one reported by the current object.

Practical scenario

A SELECT list changes but an accessor cache still binds the old final ordinal; rebuilding the map prevents it.

Difference from nearby HRESULT values

DB_E_NOCOLUMN rejects an invalid DBID, while DB_E_BADORDINAL rejects a numeric position.

Official Microsoft references


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