dmErrResourceNotFound is the error which is returned. I have tried it using
POSER with my device ROM and again it works great. But in situ (the
device), it fails.
To fix this problem, I changed my logic to try and create the database first
and every time, and then try the find, then the open again. Here is what I
ended up with that works on both POSE and the real devices.
// open a database. If it doesn't exist, create it.
static Err OpenOrCreateDB(DmOpenRef *dbP, ULong type, ULong creator,
ULong mode, UInt cardNo, char *name, Boolean *created)
{
Err err;
LocalID local = 0;
*created = false;
err = DmCreateDatabase(0, name, creator, type, false);
if (err != dmErrAlreadyExists)
*created = true;
local = DmFindDatabase(0,name);
*dbP = DmOpenDatabase(0,local, mode);
if (! *dbP)
return DmGetLastErr();
AppInfoInit(*dbP);
if (StrCompare(name,SHOPPING_LIST_DB_NAME) == 0) // if they match
{
gLastActiveForm = FrmHelloForm;
SetLastActiveForm();
}
return err;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/