On 2006-12-01, Lynn Allan <[EMAIL PROTECTED]> wrote:
><alert comment="newbie using CW9.3>
>
> The app I'm working on has a read-only 4mb .pdb comprised of about 1200
> records. I used a "tweaked" version of the par utility to build the
> BigDb.pdb and to give it the attribute of "readonly" (which is
> PRC_FLAGS_READONLY == 2).
>
> When I did this, the DmOpenDatabaseByTypeCreator seemed to suceed, but the
> call to DmNumRecords returned 0. With the attrribute left at 0, it
> correctly reports the actual number of records.
>
> Here is a snippet of the source code:
> DmOpenRef dbRef = DmOpenDatabaseByTypeCreator('CHAP',
> ......................appFileCreator, dmModeReadOnly);
> if (dbRef == NULL) {
> ..return;
> }
> UInt16 numumRecords = DmNumRecords(dbRef);
>
> The reason I ask: when I use HotSync to transfer the ReadBigDb.prc app
> to an actual device, it seems to always do a lengthy backof the
> BibDb.pdb file ... even when I am just providng a new ReadBigDb.prc
> executable. This really bogs down development.
>
> Am I doing something wrong, or leaving out a step? Once installed,
> the BigDb.pdb file doesn't change so I wouldn't think the HotSync back
> would be required each time. I thought maybe the attribute "readonly"
> would prevent that ... but then the app doesn't work.
>
> Is there an alternative way to somehow "mark" the BigDb.pdb so HotSync
> only does a backup of it the appropriate number of times (perhaps only
> once after installed)?
>
Did some testing. When you create a pdb with par with readonly attribute
and try to HotSync it (via Quick Install) to a device where it does not
exist yet, HotSync just gives an error and does not put the pdb on the device.
I guess you had a previous version already on the device, so all records
were deleted -> NumRecords = 0.
To do what you want, ReadBigDb.prc has to remove the backup attribute from
the pdb header. Then the backup conduit will not touch it.
Your ReadBigDb.prc could react on the SyncNotify notification (sent after
HotSync is finished) and then delete the backup attribute.
HTH
Ton van Overbeek
P.S. If you want me to test this strategy, please send me the code and the
pdb.
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/