What does HRESULT 0x80040E67 (DB_E_COMMANDNOTPERSISTED) mean?

 
Previous Next
DB_E_NOCOLUMN DB_E_DUPLICATEID

DB_E_COMMANDNOTPERSISTED

Meaning

Windows documents DB_E_COMMANDNOTPERSISTED as “Command does not have a DBID”. In this case, ICommandPersist is asked for the current command DBID when the command has no persistent identity.

Conditions that specifically lead to the result

  • Cause 1: the command was created only from transient text.
  • Cause 2: the provider has not saved or assigned the command a DBID.
  • Cause 3: a previously persisted command was deleted from the provider namespace.

Relevant contract

Persisted OLE DB commands use DBIDs and persistence flags that are distinct from command text. A live command can execute successfully without having a persistent identity, and a persistent name is scoped to the provider namespace.

Investigation of this result should start with the command object, current DBID, persistence flags and provider namespace.

Diagnostic sequence

  1. Identify the exact failing stage: ICommandPersist is asked for the current command DBID when the command has no persistent identity.

Evidence to collect

When recording diagnostic data involving command text, persistent command names and schema identifiers, use types, lengths, hashes or redacted identifiers rather than secrets or complete business data.

  • Evidence 1: command object identity and persistence history.
  • Evidence 2: the requested persistence operation and flags.
  • Evidence 3: whether the provider still resolves the expected DBID.

Corrective actions

  • Action 1: persist the command through the supported interface before requesting its ID.
  • Action 2: treat transient commands as having no DBID.
  • Action 3: handle deletion of persisted commands as a separate lifecycle event.

Practical scenario

A cache asks GetCurrentCommand for every ad-hoc query; checking persistence state avoids treating a transient command as named.

Retry and recovery

Retry rule: retry after successfully persisting the current command or loading an existing persisted command.

Difference from nearby HRESULT values

DB_E_BADCOMMANDID rejects an invalid command DBID, while DB_E_COMMANDNOTPERSISTED means no DBID exists.

Official Microsoft references


Looking for a different code? Search another status or error code.