"Danko Radic" <[EMAIL PROTECTED]> wrote in message
news:4511@palm-dev-forum...
> (PalmOS 3.0)
> If I'm sure that I have created record under specific uniqueID, may I
> *assume* that DmFindRecordByID would *always* find that record (so that I
> don't have to check returned error==0) returning it's index and that
> MemHandleLock(DmGetRecord(DB,index)) would *always* return valid pointer?
> The assumption is that original record with passed uniquID exists.
> Are there any circumstances when functions above can fail in spite of
> that?
The issue here is whether a user who crashes their device and then restores
his data will have the same unique IDs as before. That depends on many
things.
If your database is backed up and restored by a conduit you're writing to
go with your application, then it's up to you to make sure that unique IDs
are preserved. Test this on all platforms you support. There have been some
problems in this area with the C++ layer provided for Macintosh conduit
development, but the underlying C API for conduits supports preserving
unique IDs on PalmOS 2.0 and later devices.
If your database is backed up and restored by the standard backup conduit
(i.e. you set the backup bit on the database and don't write any conduits),
then you'll have trouble with Macintosh users since the unique IDs aren't
currently preserved in this case. PC users won't have any problems.
If you really need unique IDs to be preserved, and you want to support both
PC and Mac (which I hope you do), my advice is to write conduits for both
platforms that preserve unique IDs. Then you're in control of everything.
I'm sure you'll find the extra power a conduit provides to be addictive.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html