What does HRESULT 0x80040E28 (DB_E_BADSTATUSVALUE) mean?

 
Previous Next
DB_E_BADCOMPAREOP DB_E_CANTSCROLLBACKWARDS

DB_E_BADSTATUSVALUE

Meaning

Windows documents DB_E_BADSTATUSVALUE as “Status flag was neither DBCOLUMNSTATUS_OK nor DBCOLUMNSTATUS_ISNULL”. Here, a write or parameter binding supplies a DBSTATUS value other than the statuses accepted for input.

Relevant OLE DB contract

This result must be interpreted against this contract: OLE DB accessors describe how columns or parameters map to a consumer buffer; an HACCESSOR is object-scoped, reference-counted and inseparable from its DBBINDING layout, bound parts, data types, offsets and ownership rules.

Start with the command or rowset that created the accessor and the consumer buffer passed to the failing method when investigating this result.

Specific conditions that produce the result

  • Cause 1: the consumer passes an output-only error status back into SetData.
  • Cause 2: an uninitialized status field contains an arbitrary value.
  • Cause 3: the binding does not include status storage consistently with the buffer layout.

Evidence to collect before changing the system

  • Evidence 1: the DBSTATUS value and binding ordinal.
  • Evidence 2: which DBPART flags are bound for value, length and status.
  • Evidence 3: the buffer initialization path before the provider call.

Corrective actions

  • Action 1: initialize every bound status field explicitly.
  • Action 2: use DBSTATUS_S_OK or DBSTATUS_S_ISNULL only where the method contract permits.
  • Action 3: do not recycle output status arrays as input without normalization.

Retry and recovery policy

Retry rule: retry after correcting the status fields and validating the buffer layout.

Practical incident

A bulk updater reuses a GetData buffer containing DBSTATUS_E_CANTCONVERTVALUE as SetData input; resetting statuses to valid input values removes it.

Difference from related HRESULT values

DB_E_BADBINDINFO concerns the binding description, while DB_E_BADSTATUSVALUE concerns a status value placed in an otherwise addressable binding buffer.

Official Microsoft references


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