| Previous | Next |
| DB_E_BADACCESSORFLAGS | DB_E_BYREFACCESSORNOTSUPPORTED |
DB_E_BADSTORAGEFLAGS
Meaning
Windows documents DB_E_BADSTORAGEFLAGS as “One or more storage flags are invalid”. Here, a DBOBJECT binding contains an invalid combination of storage flags.
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 full dwFlags bitmask and requested interface.
- Evidence 2: the binding ordinal and column type.
- Evidence 3: provider-supported storage modes.
Specific conditions that produce it
- Cause 1: mutually exclusive STGM access modes are combined.
- Cause 2: unsupported creation or sharing bits are included.
- Cause 3: flags are copied from file-opening code without regard to OLE DB storage-object rules.
Retry and recovery policy
Retry rule: retry after replacing the invalid flag combination.
Corrective actions
- Action 1: construct the storage flag set from one access mode and documented modifiers.
- Action 2: remove file-system flags not valid for the OLE DB object contract.
- Action 3: validate DBOBJECT before CreateAccessor.
Practical incident
A BLOB accessor combines STGM_READ and STGM_WRITE as separate modes instead of using a valid read-write mode; correcting the mask prevents it.
Difference from related HRESULT values
DB_E_BADSTORAGEFLAG reports a valid mode that is unsupported, while DB_E_BADSTORAGEFLAGS reports an invalid flag combination.
Official Microsoft references
Looking for a different code? Search another status or error code.