What does HRESULT 0xC80004B5 (hrDatabaseInvalidPages) mean?

 
Previous Next
hrDatabaseInvalidName hrDatabaseCorrupted

hrDatabaseInvalidPages

The object and state that matter

hrDatabaseInvalidPages means the requested initial or maximum database size is not a valid page count.

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

The key comparison is: hrOutOfDatabaseSpace occurs during growth; this code rejects the size specification itself. The first useful observation is to capture page size, cpg values, alignment, maximum, and integer conversions at the API boundary. This evidence separates file identity, attachment, open-handle ownership, lock state, and structural validity.

Minimum useful trace

  • Code-specific observation: capture page size, cpg values, alignment, maximum, and integer conversions at the API boundary.
  • the canonical database path and file identity; associate it with this result rather than with a later generic exception.
  • the instance attachment list plus every session-scoped JET_DBID; associate it with this result rather than with a later generic exception.
  • open tables, transactions, maintenance, and recovery activity using the database.

How to avoid a false diagnosis

hrDatabaseInvalidNamethe database-specific name fails rules beyond a generic object name check
hrDatabaseLockedthe database is locked against the requested access mode
hrDatabaseInUsethe database still has open users or handles that block detach, delete, or exclusive work

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 requested initial or maximum database size is not a valid page count
First corrective directioncalculate sizes in pages with checked arithmetic and pass a supported nonnegative count

Attachment is an instance relationship; opening a database returns a session-scoped database ID. Close and detach are separate lifecycle steps and can fail for different outstanding owners.

Safe recovery sequence

  1. Freeze the failing request context and record 0xC80004B5, the Jet API name, and the current instance/session ownership.
  2. Verify the code-specific precondition: capture page size, cpg values, alignment, maximum, and integer conversions at the API boundary.
  3. Apply the targeted fix: calculate sizes in pages with checked arithmetic and pass a supported nonnegative count.
  4. Before retrying the operation, reconcile attachment, open/closed state, file identity, and database header status.

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.

Technical references


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