| Previous | Next |
| DB_E_NOCONSTRAINT | DB_E_BOGUS |
DB_E_COLUMNUNAVAILABLE
Requested column is valid, but could not be retrieved. This could be due to a forward only cursor attempting to go backwards in a row
Exact value and result class
DB_E_COLUMNUNAVAILABLE has unsigned value 2147749536 (0x80040EA0) and signed 32-bit value -2147217760. AllStat describes it as “Requested column is valid, but could not be retrieved. This could be due to a forward only cursor attempting to go backwards in a row”. In this result, a requested column is valid but its value cannot be retrieved in the current access sequence or row state.
The high bit is set, so DB_E_COLUMNUNAVAILABLE is a failure HRESULT. Its facility is 4 (FACILITY_ITF) and its low code is 3744 (0x0EA0). For DB_E_COLUMNUNAVAILABLE, these fields identify an interface-defined result family; they do not identify the provider instance, method, object generation or partial effects.
Contract boundary
For DB_E_COLUMNUNAVAILABLE, OLE DB distinguishes numeric ordinals, DBID-based column identifiers and per-column status. For DB_E_COLUMNUNAVAILABLE, 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 DB_E_COLUMNUNAVAILABLE should start with the current command result, rowset or row object and the metadata generation from which the column reference came. Capture DB_E_COLUMNUNAVAILABLE before ADO, ATL, .NET or a database abstraction layer replaces the native HRESULT with a generic exception.
Diagnostic sequence
- Capture raw
0x80040EA0and symbolicDB_E_COLUMNUNAVAILABLEat the native call boundary. - Identify the exact failing stage for
DB_E_COLUMNUNAVAILABLE: a requested column is valid but its value cannot be retrieved in the current access sequence or row state. - Retrieve all OLE DB error records for
DB_E_COLUMNUNAVAILABLEbefore another COM call replaces thread error information. - Compare the live object state and provider-granted capabilities with the input that produced
DB_E_COLUMNUNAVAILABLE. - Reduce the
DB_E_COLUMNUNAVAILABLEoperation to the smallest case that preserves the same column contract. - Apply one evidence-backed correction for
DB_E_COLUMNUNAVAILABLEand verify that the result is not merely replaced by a neighboring HRESULT.
Conditions that specifically lead to this result
- Cause 1 for
DB_E_COLUMNUNAVAILABLE: a forward-only row object is asked to revisit an earlier column. - Cause 2 for
DB_E_COLUMNUNAVAILABLE: overlapping IRow::GetColumns calls violate sequential access. - Cause 3 for
DB_E_COLUMNUNAVAILABLE: the provider knows the column but cannot materialize its value in the current state.
Evidence to collect
A useful DB_E_COLUMNUNAVAILABLE event records provider CLSID and version, process architecture, interface IID and method, object correlation ID, transaction state and the immediately preceding HRESULT. When recording DB_E_COLUMNUNAVAILABLE 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 for
DB_E_COLUMNUNAVAILABLE: column DBID and requested sequence. - Evidence 2 for
DB_E_COLUMNUNAVAILABLE: prior GetColumns ranges on the same row object. - Evidence 3 for
DB_E_COLUMNUNAVAILABLE: per-column DBCOLUMNACCESS status and provider error records.
Corrective actions
- Action 1 for
DB_E_COLUMNUNAVAILABLE: request forward-only columns in monotonic order. - Action 2 for
DB_E_COLUMNUNAVAILABLE: fetch overlapping values in one call when possible. - Action 3 for
DB_E_COLUMNUNAVAILABLE: recreate or refetch the row when earlier data must be revisited.
Retry and recovery
Retry rule for DB_E_COLUMNUNAVAILABLE: retry only with an access sequence supported by the row object or after obtaining a new row instance. A DB_E_COLUMNUNAVAILABLE retry is safe only when the relevant input, object generation, capability or external state has changed. Before replaying a modifying call that returned DB_E_COLUMNUNAVAILABLE, determine whether rows, schema objects or URL resources were partially created or changed.
Do not turn DB_E_COLUMNUNAVAILABLE into an unbounded retry loop. Preserve cancellation for DB_E_COLUMNUNAVAILABLE and use a fresh provider object when the failed call may have left local state ambiguous.
Difference from nearby HRESULT values
DB_E_NOCOLUMN means the column ID is invalid, while DB_E_COLUMNUNAVAILABLE means the column exists but cannot be retrieved now. Telemetry and remediation for DB_E_COLUMNUNAVAILABLE should keep these outcomes distinct.
Practical scenario
A reader fetches columns 1 through 3 and then asks again for column 2 on a sequential row; caching the first value avoids DB_E_COLUMNUNAVAILABLE. Keeping DB_E_COLUMNUNAVAILABLE with the method and object state makes this scenario diagnosable instead of reducing it to “database error”.
Developer and operations guidance
Code handling DB_E_COLUMNUNAVAILABLE should release COM objects in ownership order, retain per-row, per-column or per-property statuses, and log granted capabilities rather than only requested options. While handling DB_E_COLUMNUNAVAILABLE, opaque values such as HACCESSOR, HROW, HCHAPTER, DBID components and provider handles must remain scoped to the object that issued them.
Operational dashboards for DB_E_COLUMNUNAVAILABLE should group by provider version, interface, method and normalized failure stage. A DB_E_COLUMNUNAVAILABLE event must not expose passwords, tokens, full connection strings, unrestricted command text or raw row contents.
Official Microsoft references
- Microsoft: IRow — official documentation relevant to
DB_E_COLUMNUNAVAILABLE. - Microsoft: sequential IRow::GetColumns access — official documentation relevant to
DB_E_COLUMNUNAVAILABLE. - Microsoft: OLE DB row objects — official documentation relevant to
DB_E_COLUMNUNAVAILABLE.
Looking for a different code? Search another status or error code.