Tip of the Month (March 2004) Generating Unique Ids When Using Multiple Handhelds Say you are working on an order entry application and you want Visual CE to generate a unique ORDER_ID for each new order. If you have multiple handhelds creating orders, you need to work out a scheme such that different handhelds don't generate the same ORDER_ID. Visual CE has some tools you can use to help do this. If your application is only going to run on one handheld, an Autonumber control can be used to generate a unique ORDER_ID for each order. The Visual CE Autonumber control will generate a unique number relative to all the other ORDER_ID's already in use. However, if you are creating orders on more than one handheld, it is possible that that the Autonumber control on one handheld will generate the same ORDER_ID as on another. To accommodate this, one of the properties of an Autonumber control is the "Start" number. You can have one handheld start at 1000, another start at 2000, etc. This scheme is simple to implement and, in many cases, will do the job. However, using the "Start" property on Autonumber controls has two potential problems:
To overcome these problems...
Once you do this, all you have to do is make sure each device has a unique device name (START | SETTINGS | SYSTEM | ABOUT | DEVICE ID). |