At 9:41 AM +0200 1999/10/05, Dan Hod wrote:
>>
>> You'll have to save the database name, if you want a permanent way to point
>> to a database. Sometimes saving the creator and type will be sufficient,
>> but remember that there can be multiple databases with the same type and
>> creator.
>>
>> -David Fedor
>> Palm Developer Support
>>
>
>The reason I am not using the database name is because it takes up to 7
>ticks to call DmFindDatebase (by its name).
>DmGetNextDatabase by type creator is not good enough like you said (in case
>of non application files).
>
>Is there something better I can do to get quickest access to a database ?
In Palm OS 3.0 and later, database IDs do not change as long as the database remains,
intact, on the device. If the database is deleted or replaced via HotSync or Beaming,
for example, then the dbID will almost certainly change.
You should definitely _not_ be storing the dbID in long-term storage. But for the
duration of your app's execution it's generally fine and is considerably faster than
continuously finding it by name. Perhaps you can optimize your code to dynamically
look up your database's dbIDs by name when your app is launched, cache the info only
as long as you need it, and dump it when your app exits?
Regards,
Jim Schram
3Com/Palm Computing
Partner Engineering