| Previous | Next |
| DB_E_ROWLIMITEXCEEDED | DB_E_SCHEMAVIOLATION |
DB_E_READONLYACCESSOR
Meaning
Windows documents DB_E_READONLYACCESSOR as “Accessor is read-only. Operation failed”. Here, a write-oriented OLE DB operation is attempted with an accessor the provider treats as read-only.
Specific conditions that produce the result
- Cause 1: the accessor was created for retrieving row data and then reused for SetData.
- Cause 2: one or more bindings refer to columns that cannot be written through this rowset.
- Cause 3: the provider exposes a read-only storage object through the accessor.
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.
Evidence to collect before changing the system
- Evidence 1: the accessor flags, bindings and method that attempted the write.
- Evidence 2: column metadata showing writability and update permissions.
- Evidence 3: per-binding DBSTATUS values or provider error records from the failed operation.
Corrective actions
- Action 1: create a separate accessor whose bindings match the write operation.
- Action 2: exclude computed, bookmark or otherwise non-updatable columns from write bindings.
- Action 3: use a writable rowset or command path when the current object is intentionally read-only.
Practical incident
A consumer reuses its display accessor for IRowsetChange::SetData and includes a computed column; building an update-specific accessor avoids it.
Retry and recovery policy
Retry rule: retry after replacing the accessor or target rowset with a write-capable one; changing only the data values does not alter accessor mutability.
Difference from related HRESULT values
DB_E_WRITEONLYACCESSOR concerns reading through a write-only accessor, while DB_E_READONLYACCESSOR concerns an attempted write through a read-only accessor.
Official Microsoft references
Looking for a different code? Search another status or error code.
