| Previous | Next |
| DB_S_ASYNCHRONOUS | DB_S_ERRORSRETURNED |
DB_S_COLUMNSCHANGED
OLE DB rowset columns changed during repositioning
DB_S_COLUMNSCHANGED is HRESULT 265937 (0x00040ED1) from Microsoft OLE DB. The documented description is “Command was executed to reposition to the start of the rowset; Either the order of the columns changed, or columns were added to or removed from the rowset.” The high-order severity bit is clear, so this is a success result, but it carries more information than plain S_OK.
The provider reexecuted or repositioned the command and the rowset column order or membership changed.
Where the result is encountered
- This result can appear in scrolling or restarting a rowset; record the producing interface and method.
- This result can appear in commands whose metadata can vary; record the producing interface and method.
- It can appear in providers reexecuting schema-sensitive queries; record the producing interface and method.
Diagnostic sequence
- Capture the raw HRESULT
0x00040ED1immediately after the returning method and record whether the caller usedSUCCEEDED,FAILED, equality testing, or exception translation. - Verify the method-specific state: all ordinal-based bindings and cached metadata are rebuilt before the consumer reads the new rowset layout.
State to verify
The central question is whether all ordinal-based bindings and cached metadata are rebuilt before the consumer reads the new rowset layout.
Correct handling, retry, and recovery
Release or rebuild accessors against the new metadata. Continuing with stale ordinals can corrupt interpretation even though the HRESULT is a success value.
Evidence to preserve
- Preserve old and new IColumnsInfo metadata.
- Preserve binding ordinals and accessors.
- Preserve command execution generation.
- Preserve schema version.
- Preserve rows fetched before and after the change.
Difference from nearby HRESULT values
DB_S_COMMANDREEXECUTED describes reexecution; it identifies the resulting metadata change that requires consumer action.
Developer and administrator guidance
Practical validation scenario
A query uses a provider-specific dynamic projection. After repositioning, a new column appears; the consumer discards old accessors, rebuilds by column identity, and resumes safely.
References
Looking for a different code? Search another status or error code.
