| Previous | Next |
| DB_SEC_E_AUTH_FAILED | DB_E_CHAPTERNOTRELEASED |
DB_E_CANCELED
Meaning
Windows documents DB_E_CANCELED as “Operation was canceled”. In this case, an OLE DB operation terminates because cancellation became effective before normal completion.
Relevant contract
Cancellation can originate from the consumer, an asynchronous status object, a timeout policy, a notification veto or provider shutdown. The returned result does not by itself prove that the underlying server performed no work.
Investigation of this result should start with the operation correlation ID, cancellation source and provider phase at the moment cancellation became effective.
Diagnostic sequence
- Identify the exact failing stage: an OLE DB operation terminates because cancellation became effective before normal completion.
Conditions that specifically lead to it
- Cause 1: the application explicitly called a cancel method.
- Cause 2: a timeout or shutdown path requested cancellation.
- Cause 3: a notification receiver vetoed an operation that permits cancellation.
Evidence to collect
A useful diagnostic event records provider CLSID and version, process architecture, interface IID and method, object correlation ID, transaction state and the immediately preceding HRESULT. When recording diagnostic data involving command text, user identity and partial output data, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.
- Evidence 1: the component and timestamp that initiated cancellation.
- Evidence 2: whether the provider reported partial row or property statuses.
- Evidence 3: server-side activity showing whether work continued after the client returned.
Corrective actions
- Action 1: propagate a distinct cancellation result instead of mapping it to failure.
- Action 2: make cancellation idempotent and preserve the original correlation ID.
- Action 3: verify partial effects before replaying any modifying operation.
Retry and recovery
Retry rule: retry only when the caller deliberately starts a new operation and partial completion has been excluded.
Difference from nearby HRESULT values
DB_E_TIMEOUT reports expiration while binding to an object, whereas it records an effective cancellation request.
Practical scenario
A user cancels a long command while the server has already changed several rows; the client checks transaction outcome before offering retry. Keeping it with the method and object state makes this scenario diagnosable instead of reducing it to “database error”.
Official Microsoft references
Looking for a different code? Search another status or error code.