The TpfgPalmDbFile class provides the facilities for bothing reading
and creating Palm PDB files on your local computer.
The stream contains the AppInfo data for the database.
Contains the database attributes.
Contains the creation date of the database in GMT time[*].
Contains the Creator Id of the database.
Contains the database type.
Contains the last backup date of the database in GMT time[*].
Contains the last modification date of the database in GMT time[*].
Contains the modification number of the database.
True if the data in the object has been changed. Not really used
currently, so it should be ignored.
Contains the number of records in the database. If ceating a database,
then the RecordCount should be set first to the number of records the
database will contain.
The stream contains the SortInfo data for the database.
Contains the seed value for generating Unique ID numbers for the
Version: Word read
Contains the application-defined version of the database.
constructor Create(AFilename: string; AOpenMode: TDbOpenMode);
Creates the object, and sets the both the filename to use, and the access
mode. TDbOpenMode can be one of the following values:
- dbReadOnly - Reads in the specified file and populates the object
- dbWriteOnly - Writes out the contents of the object to the specified
file when the object is destroyed, or the Flush method is called.
- dbReadWrite - Both reads in the database file specified, and then
writes out a new copy when the object is destroyed.
Flushes the contents of the object to the given file, as long as the
access mode is not dbReadOnly.
procedure GetRecord(Index: Integer; out Attributes:
Byte; out ID: LongWord; out Category: Shortint; out Data: Pointer;
out DataSize: Integer);
Gets in the data for the specified record number (records are numbered
from 0 to RecordCount-1). Note that the pointer returned is a direct
pointer to the internal data storage of that record, not a copy.
procedure SetRecord(Index: Integer; Attributes: Byte;
ID: LongWord; Category: Shortint; Data: Pointer; DataSize: Integer);
Sets the data for the specified record number. The data block passed to
the method is copying for internal storage, so the caller is responsbile
for destroying their data block after calling the method.
The unit pfgPalmMisc.pas has two helper methods, DateTimeToGMTDateTime,
and GMTDateTimeToDateTime for converting between local time and GMT time.