Hello All,

I must be having a dumba@! attack this week but I just can't get this code
to work. I keep getting a "Bad DBRef" error from debug roms in POSE. What
the heck am I missing here??

TIA,

Andy

Code as follows:


static DmOpenRef     gDataBase;
#define kDBName               "Drugs-IVRT"
#define kDBCreator            'IVRT'
#define kDBType               'Drgs'


static Err AppStart(void)
{
   Err error = 0;
   
   //open database
   gDataBase = DmOpenDatabaseByTypeCreator (kDBType, kDBCreator,
dmModeReadWrite);
   
   if (!gDataBase)   //if it is not created. Create it.
      {
         error = DmCreateDatabase (0, kDBName, kDBCreator, kDBType,  false);
         ErrFatalDisplayIf(error, "Could not create new database.");
         
         gDataBase = DmOpenDatabaseByTypeCreator (kDBType, kDBCreator,
dmModeReadWrite);
         ErrFatalDisplayIf(error, "Could open newly created database.");
         
         if (gDataBase)
            {
               InitDrugs();
            }
      }  

Code clipped here...........

   return errNone;
}

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