I'm having trouble understanding how external memory should be used. I would
like to have the option of moving some of my very large database files onto
external memory (expansion cards). My startup code is the standard:

dbHandle = DmOpenDatabaseByTypeCreator(dbType, creator, dmModeReadWrite);
if (dbHandle == 0)
{
    // the database does not exist, create it now
    DmCreateDatabase(0, dbName, creator, dbType, false);
    // open the newly created database
    dbHandle = DmOpenDatabaseByTypeCreator(dbType, creator,
dmModeReadWrite);
}
// get the localID and card number of the database
LocalID localID;
UInt16 cardNo;
DmOpenDatabaseInfo(dbHandle, &localID, NULL, NULL, &cardNo, NULL);
// get the attributes and the version number
UInt16 version, attributes;
DmDatabaseInfo(cardNo, localID, NULL, &attributes, &version, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL);
...

My assumption was that when you initially open a database,
DmOpenDatabaseByTypeCreator would find the database even if it is not on
card 0. If a database is NOT found on external memory, DmCreateDatabase
would create it on card 0, but if there was one on another card, the first
DmOpenDatabaseByTypeCreator should find it.

I do not have a real external memory card to test this on, but have
simulated external memory using HostFS and POSE. Using DigiBrowse I can see
that the database is in external memory and that it has been removed from
main memory. The bottom line is that the first DmOpenDatabaseByTypeCreator
does not find the database on external memory.

Help,

Laurie



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to