What does HRESULT 0xC8000404 (hrInvalidDatabase) mean?

 
Previous Next
hrTooManyOpenDatabases hrNotInitialized

hrInvalidDatabase

Interpretation in ESE terms

hrInvalidDatabase means the selected file is not a usable ESE database for this operation.

This is the legacy Directory Service backup/restore HRESULT form of JET_errInvalidDatabase (0xC8000404).

The key comparison is: hrDatabaseCorrupted indicates damage or an unavailable database; this result can simply be the wrong file type. The first useful observation is to inspect the file type, header, page size, provenance, and whether a log, checkpoint, or unrelated file was supplied. This evidence separates file identity, attachment, open-handle ownership, lock state, and structural validity.

The ESE objects in play

Diagnostic layerdatabase file, attachment state, JET_DBID ownership, and database lifecycle
Typical API surfaceJetCreateDatabase, JetAttachDatabase, JetOpenDatabase, JetCloseDatabase, and JetDetachDatabase
Code-specific conditionthe selected file is not a usable ESE database for this operation
First corrective directionlocate the correct database artifact and verify it with read-only tooling before attachment

Creating an empty file is not a valid substitute for a missing or corrupted ESE database. Attachment is an instance relationship; opening a database returns a session-scoped database ID.

Comparison with adjacent failures

hrDatabaseNotFounda valid database name or path did not resolve to an attached or existing database
hrInvalidDatabaseIdthe JET_DBID no longer identifies an open database in the supplied session
hrDatabaseLockedthe database is locked against the requested access mode

What to capture before retrying

  • Code-specific observation: inspect the file type, header, page size, provenance, and whether a log, checkpoint, or unrelated file was supplied.
  • open tables, transactions, maintenance, and recovery activity using the database.
  • the canonical database path and file identity.
  • the instance attachment list plus every session-scoped JET_DBID.

Actions that can hide or worsen the problem

  • Do not create an empty database at the expected path as a substitute for the missing or damaged artifact.
  • Do not force detach or delete while owners and recovery state are unknown.

Operational response

  1. Freeze the failing request context and record 0xC8000404, the Jet API name, and the current instance/session ownership.
  2. Verify the code-specific precondition: inspect the file type, header, page size, provenance, and whether a log, checkpoint, or unrelated file was supplied.
  3. Apply the targeted fix: locate the correct database artifact and verify it with read-only tooling before attachment.
  4. Before retrying the operation, reconcile attachment, open/closed state, file identity, and database header status.

Technical references


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