| Previous | Next |
| DB_E_BADROWHANDLE | DB_E_BADCHAPTER |
DB_E_OBJECTOPEN
Meaning
Windows documents DB_E_OBJECTOPEN as “Object was open”. Here, an OLE DB operation requires an object to be closed but a dependent rowset, command result or storage object is still open.
Relevant OLE DB contract
This result must be interpreted against this contract: OLE DB objects follow both COM lifetime rules and provider-specific state contracts; open dependents, ownership transfer, aggregation, callbacks and namespace identity must be traced from the exact interface call rather than inferred from a wrapper exception.
Start with the COM object that returned the result and every dependent interface or provider-owned resource involved in the call when investigating this result.
Specific conditions that produce the result
- Cause 1: an active rowset still references the command being changed or unprepared.
- Cause 2: a table, index or stream is open while a definition operation targets it.
- Cause 3: the consumer leaked an interface or row handle that keeps the provider object active.
Evidence to collect before changing the system
- Evidence 1: the exact object and operation blocked by the open dependency.
- Evidence 2: outstanding interface counts, rowsets, rows, chapters and storage objects.
- Evidence 3: the creation stack or correlation ID for every dependent object not yet released.
Corrective actions
- Action 1: close result rowsets and release row, chapter and stream handles in reverse ownership order.
- Action 2: separate metadata changes from active query lifetimes.
- Action 3: add deterministic cleanup around every early-return and cancellation path.
Retry and recovery policy
Retry rule: retry after all documented dependent objects are closed; waiting alone is insufficient if a reference leak keeps them open.
Practical incident
A service calls ICommandPrepare::Unprepare while a rowset produced by that command is still alive; releasing the rowset first removes it.
Difference from related HRESULT values
DB_E_TABLEINUSE and DB_E_INDEXINUSE name specific schema objects in use, while DB_E_OBJECTOPEN is the general object-state failure.
Official Microsoft references
Looking for a different code? Search another status or error code.