Site icon EfmSoft

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

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

Technical references


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

Exit mobile version