| Previous | Next |
| DB_E_CANTSCROLLBACKWARDS | DB_E_NONCONTIGUOUSRANGE |
DB_E_BADREGIONHANDLE
Meaning
Windows documents DB_E_BADREGIONHANDLE as “Region handle is invalid”. Here, a view or notification method receives a watch-region handle that is not valid for the active rowset view.
Specific conditions that produce the result
- Cause 1: the region handle was deleted or released.
- Cause 2: the handle belongs to another view instance.
- Cause 3: the view was recreated and old region handles were retained.
Relevant OLE DB contract
This result must be interpreted against this contract: OLE DB views and find operations derive row ranges from an accessor, comparison operators, current ordering and region state; handles and containment relationships become stale when the view, filter or rowset generation changes.
Start with the active rowset view, its criteria accessor and the region or row sequence supplied by the consumer when investigating this result.
Evidence to collect before changing the system
- Evidence 1: the region handle and view identity.
- Evidence 2: the call that created, changed or released the region.
- Evidence 3: the rowset generation and notification subscription state.
Corrective actions
- Action 1: scope region handles to one view lifetime.
- Action 2: clear cached handles when a view is replaced.
- Action 3: recreate the watch region from current rows and criteria.
Practical incident
A monitoring component rebuilds an IRowsetView after changing its filter but keeps the previous region handle; recreating the region prevents it.
Retry and recovery policy
Retry rule: retry only with a region handle created by the current view.
Difference from related HRESULT values
DB_E_NOTASUBREGION describes a valid region relationship that fails a subregion requirement, while DB_E_BADREGIONHANDLE means the handle itself is invalid.
Official Microsoft references
Looking for a different code? Search another status or error code.