The Database Header Page

The database header page (DBH) is the first page of data in every Microsoft Jet database. A page is defined as 2K (or 2048 bytes) of data. The DBH is primarily used to store commit byte(s) for each of the 255 possible users connected to the database. A commit byte (or pair of bytes in Microsoft Jet 3.0 and 3.5) is a value used by the database engine to determine the state of the database.

Microsoft Jet version 2.x uses 256 bytes to store the commit byte starting at 700h and continuing to the end of the page at 800h. Microsoft Jet 3.0 and 3.5 use 512 bytes that use 2 bytes per user starting at 600h. The first byte (version 2.x) or the first 2 bytes (versions 3.0 and 3.5) are used only when the database is open in exclusive mode, and the remaining 255 bytes (version 2.x) or 510 bytes (versions 3.0 and 3.5) are used when the database is open in shared mode.

Commit bytes in Microsoft Jet 2.0 databases have only two valid values, 00 and FF. The 00 value indicates a neutral state and the FF value indicates that the engine is in the process of physically writing data to the disk. If the database has an FF value and no corresponding user lock, then a user interrupted the process of writing to disk. New users attempting to open the database receive the message Database is corrupt or is not a database file and will be forced to repair the database before opening it.

Note If an application using an earlier version of Microsoft Jet tries to open a database created with a later version, it will also receive the Database is corrupt or is not a database file message. If your application will be working in a mixed-version environment, you may need to account for this possibility.

Commit bytes in Microsoft Jet 2.5 databases have five valid values ranging from 00 to 04. This range of values provides more information about what users were doing if the database was left in a suspect state. As with Microsoft Jet 2.0, the database is in a suspect state if there is a nonzero value without a corresponding user lock. A value of 00 represents a neutral state. A value of 01 indicates that a user accessed a corrupted page in the database. The value 02 indicates that the database is being created. A value of 03 indicates that the database is being repaired. A value of 04 indicates that the user is in the process of committing a transaction to disk.

Commit bytes in Microsoft Jet 3.0 and 3.5 can have many different values; thus their size has been increased to 2 bytes. Values of 00 00 indicate that the user is in the process of committing a transaction to disk, and values of 01 00 indicate that a user has accessed a corrupted page. Thus, if a value of 00 00 is present without a corresponding user lock, or if a value of 01 00 is present, users will not be able to open the database without first repairing it. Additional values in the 600 – 800h range are used internally by Microsoft Jet for performance tracking, mainly to determine if other users have written data to the database file. If Microsoft Jet determines that other users have not written data to disk, it will delay refreshing its internal cache, resulting in fewer disk reads.

See Also To view the commit byte values discussed in this section and to see what users are currently logged onto the database, you can use the Ldbview.exe utility in the \Utilities\Ldbview folder on the companion CD-ROM. For information about how to use this utility, see the “Understanding Microsoft Jet Locking” white paper in the Papers folder on the companion CD-ROM. Its file name is Jetlock.doc.