What does HRESULT 0x80040E4C (DB_E_WRITEONLYACCESSOR) mean?

 
Previous Next
DB_E_BADACCESSORTYPE DB_SEC_E_AUTH_FAILED

DB_E_WRITEONLYACCESSOR

Meaning

Windows documents DB_E_WRITEONLYACCESSOR as “Accessor is write-only”. In this case, a consumer attempts to read data through an accessor whose bindings support only writing values to the provider.

Relevant contract

Accessors are created on a specific command or rowset and encode direction, purpose, bound parts and buffer ownership. A valid HACCESSOR on one object is not interchangeable with a parameter accessor, a readable row accessor or an accessor created for another generation.

Investigation of this result should start with the object that created the accessor, its DBACCESSORFLAGS and every DBBINDING entry.

Evidence to collect

When recording diagnostic data involving parameter values, row values and provider-owned storage pointers, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.

  • Evidence 1: the bound DBPART values and accessor direction.
  • Evidence 2: the method trying to retrieve data.
  • Evidence 3: whether a second accessor exists for output or row reads.

Conditions that specifically lead to it

  • Cause 1: the accessor was deliberately created for SetData or input parameters.
  • Cause 2: direction flags were copied from a write path into a fetch path.
  • Cause 3: a provider exposes separate read and write accessor capabilities.

Diagnostic sequence

  1. Identify the exact failing stage: a consumer attempts to read data through an accessor whose bindings support only writing values to the provider.

Retry and recovery

Retry rule: retry with a readable accessor and a buffer whose ownership matches the retrieval method.

Corrective actions

  • Action 1: create a readable accessor for the retrieval path.
  • Action 2: keep input and output accessor caches separate.
  • Action 3: validate accessor purpose before issuing GetData or output-parameter retrieval.

Practical scenario

An update component reuses its write-only accessor for verification reads; a dedicated read accessor allows the row to be fetched.

Difference from nearby HRESULT values

DB_E_READONLYACCESSOR rejects writes through a read-only accessor, while DB_E_WRITEONLYACCESSOR rejects reads through a write-only accessor.

Official Microsoft references


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