At 10:04 AM 15/3/2002 -0800, you wrote:
>I wanted to delete all databases with a given creatorID, so I wrote this
>code:
>
>err = errNone;
>newSearch = true;
>while (errNone == DmGetNextDatabaseByTypeCreator(newSearch, &searchState,
> NULL, creatorID, false, &cardNo, &dbID))
>{
> newSearch = false;
> err = DmDeleteDatabase(cardNo, dbID);
> if (err)
> break;
>};
>
>return err;
>
>To my surprise, this code did not work. On further testing, I found that
>the code would delete a max of six databases, so that if there were more
>than six with the same creator ID, the rest would not be deleted. Stranger
>still, I found that the above code had to be executed three times to insure
>that all databases with the same creator ID got deleted, at least with the
>examples I tried (perhaps it would still fail if there were more databases
>than I tried this with).
I would guess that when you delete a database, the next call
DmGetNextDatabaseByTypeCreator starts where it left off, right where you
just removed a database. If the one that is was "the next database" is the
same creator, it will get skipped. Same as deleting records and
incrementing the index...
Matt
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/