I'm a newbie Palm developer.

I am writing an application that needs to store two distinct types of
records.  I want to keep one of these record types sorted by index in the
database.  I assume that this implies that I need to create two databases.
In my AppStart method, I call DmCreateDatabase twice, but when I tap on
info, I see that only the database named in the last call seems to be shown
in my list of installed applications and database.  The code looks like
this:

//attempt to open first database, if it doesn't exist, create a new one
firstDatabase = DmOpenDatabaseByTypeCreator(dbOneType, appFileCreator,
dmModeReadWrite | dmModeShowSecret);
if(! firstDatabase)
{
        DmCreateDatabase(0, DbOneName, appFileCreator, dbOneType, false);
        binkDb = DmOpenDatabaseByTypeCreator(dbOneType, appFileCreator,
dmModeReadWrite | dmModeShowSecret);
}


//attempt to open secod database, if it doesn't exist, crate a new one
secondDatabase = DmOpenDatabaseByTypeCreator(dbTwoType, appFileCreator,
dmModeReadWrite | dmModeShowSecret);
if(! secondDatabase)
{
        DmCreateDatabase(0, dbTwoName, appFileCreator, dbTwoType,false);
        tranDb = DmOpenDatabaseByTypeCreator(dbTwoType, appFileCreator,
dmModeReadWrite | dmModeShowSecret);
}


So my question comes in 2 parts:
1) Do I need two databases to keep two sorted collections of disparate
records, or is there some preffered way of maintaining this information in a
single database?

2) If I do need two databases, how do I create the second one?

Matthew Starensier

R  o  m  e  B  l  a  c  k  ,  I  n  c  .
__________________________________________________________
i n t e r a c t i v e  s o f t w a r e  a n d  d e s i g n

t e l : 2 1 2 . 7 2 7 . 9 7 3 5
f a x : 2 1 2 . 7 2 7 . 9 5 4 6
u r l : http://www.romeblack.com


-- 
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