When my app starts up, I scan for all my databases using a
DmGetNextDatabaseByTypeCreator loop specifying my creator ID and a type code
of zero. While building my list of databases, I also look for obsolete
database types or old version databases that could be present on the Palm
when the user upgrades the app to the newest version. I have to delete these
old databases, or else the user has no way to get rid of them unless they
"hack around" with DB Explorer or some other special tool (in fact, they
would be unaware that the old DBs even exist even though they are sitting
there taking up space).
In any case, I was originally doing this by putting a DmDeleteDatabase call
inside the while-loop where I call DmGetNextDatabase. What I found was that
this caused the database lookup routine to work incorrectly, and not all the
existing databases were being returned. I noticed this when I got my "Old
databases deleted" alert two times in a row when running my app, when it
should only come up once no matter how many old databases exist.
Anyway, I fixed this by saving the card & ID of obsolete databases in an
array while I'm inside the GetNext loop. Afterwords, another loop goes
through the array and deletes the old databases. This now works correctly.
Doug Gordon
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html