[Introduction] [Address.dat/Address.aba] [Memopad.dat/Memopad.mpa]
[Todo.dat/Todo.tda] [Users.dat] [Not So FAQ's] [Home]

Palm Pilot Desktop Software DATEBOOK.DAT and DATEBOOK.DBA File Structure

Field Name Type Size Comments
Version Tag Char 4*Byte 0x00 0x01 0x42 0x44 (DB10) for Datebook
File Name CString   Fully Qualified Filename of file on PC
Table String CString   Custom show header
Next Free Long 4*Byte Next Free Category ID
Category Count Long 4*Byte Count - 1 of the number of category entries (does not include Unfiled category)
Category entries Category-Entry   Occurs category count times (Note: the standard Palm datebook doesn't use categories, but the feature is actually supported. 3rd party software may rely on categories, so you should allow for the possibility in your programming.)
Resource ID Long 4*Byte Schema Resource ID
Fields per Row Long 4*Byte Schema Fields per row. Will be 15 for datebook.
Rec ID Pos Long 4*Byte Schema Record ID Position (index to field table entry that contains record id)
Rec Status Pos Long 4*Byte Schema Record Status Position (index to field table entry that contains record status)
Placement Pos Long 4*Byte Schema Placement Position (index to field table entry that contains record placement position)
Field Count Short 2*Byte Schema Field Count (number of fields in schema) Corrected April 19, 2000
Field Entry Short 2*Byte Schema field entry occurs field count times. For datebook the entries will be 1,1,1,3,1,5,1,5,6,6,1,6,1,1,8 Corrected April 19, 2000
Num Entries Long 4*Byte Record count * 15 (number of field entries in entire file, as noted, divide by 15 to arrive at actual record count)
Datebook entry Datebook-Entry   Occurs with record count (note, these records may be sorted in a specific order. It looks like the repeating events are first in the file. If you are adding records to the file, you may need to insert the records in the proper sort order)

Category-Entry

Field Name Type Size Comments
Index Long 4*Byte Category Index
ID Long 4*Byte Category ID
Dirty Flag Long 4*Byte Category Dirty Flag
Long Name Cstring   Long Category Name
Short Name Cstring   Short Category Name

Datebook-Entry

Field Name Type Size Comments
Field Type Long 4*Byte value 1 Integer
Record ID Long 4*Byte
Field Type Long 4*Byte value 1 Integer
Status Field Long 4*Byte Bitwise Record Status: Pending = 0x08, Add = 0x01, Update = 0x02, Delete = 0x04, Archive = 0x80
Field Type Long 4*Byte value 1 Integer
Position Long 4*Byte
Field Type Long 4*Byte value 3 Date
Start Time Long 4*Byte Number of non-leap seconds since Jan 1, 1970 GMT
Field Type Long 4*Byte value 1 Integer
End Time Long 4*Byte Number of non-leap seconds since Jan 1, 1970 GMT
Field Type Long 4*Byte value 5 Cstring
Padding Long 4*Byte Always Zero Correction as of Nov 16, 1999
Description Cstring
Field Type Long 4*Byte value 1 Integer
Duration Long 4*Byte
Field Type Long 4*Byte value 5 Cstring
Padding Long 4*Byte Always Zero Correction as of Nov 16, 1999
Note Cstring
Field Type Long 4*Byte value 6 Boolean
Untimed Long 4*Byte
Field Type Long 4*Byte value 6 Boolean
Private Long 4*Byte
Field Type Long 4*Byte value 1 Integer
Category Long 4*Byte
Field Type Long 4*Byte value 6 Boolean
Alarm Set Long 4*Byte
Field Type Long 4*Byte value 1 Integer
Alarm Adv Units Long 4*Byte Alarm Advance time units
Field Type Long 4*Byte value 1 Integer
Alarm Adv Type Long 4*Byte 0-Minutes, 1-Hours, 2-Days
Field Type Long 4*Byte value 8 Repeat event
Repeat Event Repeat-Event  

Repeat-Event

Field Name Type Size Comments
Date Exceptions Short 2*Byte Count of any date exception entries Corrected Nov 16, 1999
Exception entry Long 4*Byte date exception entry, occurs with Date Exceptions. If date exceptions is zero, there will be no entries here.
Repeat Event Flag Short 2*Byte IMPORTANT 0xFFFF means that a class name record follows.
0x0000 that nothing further follows, you should stop reading the record.
Any other value will be the brand of the repeat event or'd with 0x8000
Class entry Class-Entry   This field is present ONLY if the repeat event flag is 0xFFFF
Brand Long 4*Byte The Brand of the repeat event. Possible values are:
1 = Daily
2 = Weekly
3 = MonthlybyDay
4 = MonthlybyDate
5 = YearlybyDate
6 = YearlybyDay
Note that this field is present ONLY if the repeat event flag was NOT 0x0000
Interval Long 4*Byte Note that this field is present ONLY if the repeat event flag was NOT 0x0000
End Date Long 4*Byte Note that this field is present ONLY if the repeat event flag was NOT 0x0000
First Day of Week Long 4*Byte Note that this field is present ONLY if the repeat event flag was NOT 0x0000
Brand Data Brand-Data Variable brand data that depends upon the value of the Brand field
Note that this field is present ONLY if the repeat event flag was NOT 0x0000

Class-Entry

Field Name Type Size Comments
Constant Short 2*Byte Constant 1
Length Short 2*Byte Length of Class Name
Class Name Char Byte Class name of length specified.

Brand-Data

Field Name Type Size Comments
Day Index Long 4*Byte Present ONLY for Brand = 1 or Brand = 2 or Brand = 3
Days Mask Char 1*Byte Present ONLY for Brand = 2
Week Index Long 4*Byte Present ONLY for Brand = 3
Day Number Long 4*Byte Present ONLY for Brand = 4 or Brand = 5
Month Index Long 4*Byte Present ONLY for Brand = 5

Cstrings

Cstrings are stored as follows:
  1. Strings less than 255 bytes are stored with the length specified in the first byte followed by the actual string.
  2. Zero length strings are stored with a 0x00 byte.
  3. Strings 255 bytes or longer are stored with a flag byte set to 0xFF followed by a short (2*Byte) that specifies the length of the string, followed by the actual string.

Date Fields

Date fields are stored as a long that represents the number of non-leap seconds since January 1, 1970 GMT. Note that this differs from the capabilities of the PalmOS representation on the handheld, which uses a 32 bit unsigned integer to represent the number of seconds since January 1, 1904.

Field Types

The schema mechanism uses field types to identify the data. The meanings of the field types are in the table below.

Number Meaning
0 None
1 Integer
2 Float
3 Date
4 Alpha
5 Cstring
6 Boolean
7 Bitflag
8 RepeatEvent


Last updated: October 26, 2002