What does HRESULT 0x80040E00 (DB_E_BADACCESSORHANDLE) mean?

 
Previous Next
VFW_E_BAD_KEY DB_E_ROWLIMITEXCEEDED

DB_E_BADACCESSORHANDLE

Meaning

Windows documents DB_E_BADACCESSORHANDLE as “Accessor is invalid”. Here, an OLE DB command or rowset receives an HACCESSOR that is not valid for that object.

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 accessor was released and its stale handle was reused.
  • Cause 2: the handle was created on a different command or rowset.
  • Cause 3: the command definition changed and the consumer kept an accessor whose bindings no longer belong to the active object.

Evidence to collect before changing the system

  • Evidence 1: the interface and method receiving the handle, plus the command or rowset identity.
  • Evidence 2: the CreateAccessor and ReleaseAccessor sequence with reference counts.
  • Evidence 3: the DBBINDING array and object instance associated with the handle.

Corrective actions

  • Action 1: recreate the accessor on the object that will consume it.
  • Action 2: pair every accessor handle with its owning COM object and lifetime.
  • Action 3: invalidate cached accessors whenever command metadata or rowset generation changes.

Retry and recovery policy

Retry rule: retry only with a newly validated accessor created on the current object; repeating the call with the same stale HACCESSOR is unsafe.

Practical incident

A pooling layer stores an accessor handle from an old command and applies it to a replacement command; recreating the accessor on the replacement removes it.

Difference from related HRESULT values

DB_E_BADBINDINFO means the binding description is invalid, while DB_E_BADACCESSORHANDLE means the handle itself is not valid for the receiving object.

Official Microsoft references


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