Christopher Hunt wrote:
> ...then I discovered that the modification date of the db is less than the
> creation date. I'm wondering if HotSync rejects this scenario. :-|
>
> I further noticed that the creation date is for 2003 and not 1999! I'm
> wondering if HotSync forgets that years start at 1904 when it comes to saving a
> .pdb and updating its header.
Yep, its the dates. The following snippet of code completely fixes the problem. I
strongly suspect that the MacPac does not consider 1904 as a start date when
HotSync writes db header information.
*****
UInt theMode = dmModeReadWrite;
/*
* Find the application's database.
*/
UInt theCardNo; // Card containing the application database
LocalID theDbID; // Handle for application database
DmOpenRef theDB = ::DmOpenDatabaseByTypeCreator(
APPLICATION_MAINDB_TYPE,
APPLICATION_CREATOR,
theMode
);
if (theDB)
{
mDBCloser = DmCloseDatabaseSentry(theDB);
// Place theDB under ownership so that it'll close auto-
// matically.
/*
* Get info about the database
*/
ThrowIfErr_(::DmOpenDatabaseInfo(theDB, &theDbID, NULL, NULL, &theCardNo,
NULL));
/*
* Set the new attributes in the database
*/
ULong theCurrentTime = ::TimGetSeconds();
ULong theModNumber = 0;
ThrowIfErr_(::DmSetDatabaseInfo(
theCardNo,
theDbID,
NULL,
NULL,
NULL,
&theCurrentTime,
&theCurrentTime,
&theCurrentTime,
&theModNumber,
NULL,
NULL,
NULL,
NULL
));
}
*****
--
Christopher Hunt
Class Action Pty. Ltd.
Are you a time zone traveler that owns a Palm(tm) connected organizer?
Check out http://www.classactionpl.com/TimeTraveler/index.htm