Just to keep the record straight, there is a definition of the "reserved" range of unique id's in the PalmSource knowledge base.
Go to kb.palmsource.com and search on "unique". Go to the article titled: "How are database unique IDs assigned when a record is added to a database?" If your PC app sets the top 12 bits of the unique id to 0 or 1 (as defined by dmRecordIDReservedRange in DataMgr.h) it will not conflict with unqiue id's generated by the HH device. I still think you have to be crazy to attempt this. Sorry for the earlier misinformation... Dave ===================================================================== On Thu, 20 Nov 2003 10:50:50 Dave Lasker wrote: Are you aware of the limitations of the uniqueness of the unique id? See http://www.escribe.com/computing/pcpqa/index.html?by=OneThread&t=Uniqueness%20of%20UniqueIDs%3F and several other threads in this group for more info. If you are still willing to stick with your approach, read on... If you look at the OS source code for DataMgr.c, you will see there is a reserved range for newly generated unique ids. Since this is not documented anywhere that I could find, it is probably a mistake to depend on it. It's best to assume a unique id is a pseudo-random number in the range 0x00000001..0x00ffffff. The "correct" way to solve your problem is use a unique id of 0 in your PC database for newly created records. When you hotsync, the HH assigns a new id based on the seed in its header. That new id should then be written back to your PC database. If you need a non-zero key for newly created PC records prior to hotysync, then you should add an additional field to your PC database. HTH... Dave "Jim Worden" wrote in message news:[EMAIL PROTECTED] > I am using the unique ID generated for each record to index into my database > using the DmFindRecordByID function. It works well and the handheld > automatically generates the ID so it makes a handy key. Occasionally I need > to generate records on the PC side and I want to generate a temporary ID for > use just until the next sync when the handheld will generate the permanent > ID. > > I just need to know how the ID is generated so I can be sure that my > temporary IDs don't accidentally duplicate a permanent ID. The docs I've > found so far just tell me the ID is automatically generated, not how. Is > there a minimum or maximum value I can use to make sure my IDs are safe? > > Thanks in advance. > > Jim Worden -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
