Ana,

I think that CreatorIDs can only be four characters (bytes?), so 'Airport'
should cause an error.  If this compiles then perhaps I am mistaken.  What
mode are you using (dmReadWrite allows for both reading and writing).  Are
you checking the error value after the create, and then does the Open
function return a valid (ie non null) pointer?  Also, you present the
functions in reverse order, first open, then create.  The functions you are
using are correct, but here is how I use them:

   *dbP = DmOpenDatabaseByTypeCreator(type, creator, mode);
   err = DmGetLastErr();
   if(!*dbP) // need to create the db
   {
      err = DmCreateDatabase(0, name, creator, type, false);
      if(err)
         return err;

      *dbP = DmOpenDatabaseByTypeCreator(type, creator, mode);
      if(!*dbP)
         return DmGetLastErr();
   }

It looks like you are using appName instead of db name for your name on the
create command.   This will cause a problem.  Your database cannot have the
same name as the app.

Paul

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of ana
erdozain
Sent: Friday, May 17, 2002 3:06 PM
To: Palm Developer Forum
Subject: create a database..


Hi!
I am trying to create a database in my application.
To create the database and open it I use these
functions:

dbP = DmOpenDatabaseByTypeCreator(
appDBType,appCreator, mode);

error = DmCreateDatabase (0, appName,
appCreator,appDBType, false);

where appDBType is data and appCreator is 'Airport'.

When I load this application in the pda (with hot
sync) and the application runs, if try to get data
from the database an error occurs, and the application
must be reset.

1- Could this error happens by the way to open or
create this database? Because in one example, I have
seen, that the variable appCreator isnt definer in
the own program.

2-which launch codes I need?
SysAppLaunchCmdInitDatabase and
sysAppLaunchCmdSyncNotify. Are needed?

I get the data from a connection, I open a socket (I
use net library)        and I receive a string of data, I
convert this string of data to the database.
Thank you in advanced!
Ana


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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

Reply via email to