Tanx everyone this is no longer an issue and i have both databases up and running :)
-----Original Message----- From: Greg Sepesi [mailto:[EMAIL PROTECTED] Sent: 23 March 2005 12:30 To: Palm Developer Forum Subject: Re: DmOpenRef error "ULStudent:Robert.Conlon" wrote: > > I no longer get the DmOpenRef error but the second database with DmOpenRef declaration db2 still wont create. Here is my app start function (sorry for putting code up) but can you possibly see why the first database with DmOpenRef db is created while the second is not. > > static Err AppStart(void) > { > > Err error = 0; > Err retcode = 0; > // open my own Database > db = DmOpenDatabaseByTypeCreator(DBType,CreatorID,dmModeReadWrite); > // Create it, if it does not exist > if(!db) > { > // Tell the user that we're creating a new DB > error = DmCreateDatabase(0,DBName,CreatorID,DBType,false); > if(error) > return error; > // Now, we should be able to open it > db = DmOpenDatabaseByTypeCreator(DBType,CreatorID,dmModeReadWrite); > return DmGetLastErr(); > > > } > > > db2 = DmOpenDatabaseByTypeCreator(PrefDBType,PrefCreatorID,dmModeReadWrite); > if(!db2) > { > error = DmCreateDatabase(0,DBNamePref,PrefCreatorID,PrefDBType,false); > if(error) > return error; > > db2 = DmOpenDatabaseByTypeCreator(PrefDBType,PrefCreatorID,dmModeReadWrite); > return DmGetLastErr(); > > > } > > > nbRec = DmNumRecords(db); > > > return retcode; > } What was your intended purpose for the "return DmGetLastErr()" after creating the first database? Greg -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
