Hello Roger,

      OK for the creator IDs. Thank again.

      I've been testing with a single database in order to simplify my
      problems... Now, when I delete my application on the
      Palm, and I install a new version, I've got a problem because I
      can't create the new database and my code goes to an infinite
      loop. I try to open the database "by creator" on my "AppStart"
      function, but I can't (so I've made a control loop that creates
      a new database if I can't open the existing).
      I've found the "dmErrAlreadyExists" control who let me see
      if the database already exists. So, when I erase my application,
      the database is in Palm's memory and my question is: wy does the
      database exist if I've erased my app and why can't I open the
      database?

      This is my code, with the modifications that I've made to
      correct the problem. I don' know if this is a good code, but...
      is this the only way to do that? Is this "normal"? How can I
      erase the databases when I erase my application?

       mode = dmModeReadWrite;
       gDB = DmOpenDatabaseByTypeCreator( AppDBType, AppFileCreator, mode );
       // If database does not exist, we create a new one with
       // the "AppDBName" name, the "AppFileCreator" creator ID and the
       // "AppDBType" type...
       if ( !gDB )
       {
                error = DmCreateDatabase( 0, AppDBName, AppFileCreator, AppDBType, 
false );
                // If we get an error, we could not create the database... STOP!
                if ( error == dmErrInvalidDatabaseName)
                        return error = 4;
                else if (error == dmErrAlreadyExists)
                {
                        // On debbuger I get this error...
                        return error = 5;
                        // ... so I think that I would do that:
                        // DmDeleteDatabase(0, DmFindDatabase(0, AppDBName));
                        // ... and create a new one ...
                        // DmCreateDatabase( 0, AppDBName, AppFileCreator, AppDBType, 
false );
                }
                else if ( error)
                        return error;

                // ... and so on ...  looking for all the errors ...
                        
                // Once created, we open the database
                gDB = DmOpenDatabaseByTypeCreator( AppDBType, AppFileCreator, mode );
                if ( !gDB )
                        return( 1 );
        }

-- 
Best regards,
 Jose         mailto:[EMAIL PROTECTED]


Tuesday, June 20, 2000, 2:26:51 PM, you wrote me:

RC> If all your databases have the same creator ID as your application, 
RC> they will not appear in the app launcher, nor will they appear in the 
RC> launcher's Delete list. For every application the launcher finds (that 
RC> is, databases having type 'appl', it "hides" all other databases having 
RC> that same creator ID behind the application, so to speak.

RC> The names of the databases have nothing to do with this. They must, 
RC> however, all be unique. It seems to me that the scheme you are 
RC> proposing will work just fine.


RC> Jose Rodriguez Ruibal <[EMAIL PROTECTED]> wrote:
>>       I'm planning a system architecture like this:
>> 
>>       We have a main database "A" who stores some records with some
>>       information:
>>                   A1
>>                   A2
>>                   A3
>>                   ... and so on ...
>>       Each record has a "link" to another database file:
>>                   AB1
>>                   AB2
>>                   AB3
>>       How can I manage all the data without letting the user "see" the
>>       databases in memory (with the "info" menu from the application
>>       launcher). I mean, if I use the standar naming
>>       convention "AppDBName-CreatorID" this would work? Could I have
>>       all my databases like this:
>>           AppA1-CreatorID
>>           AppA2-CreatorID
>>           AppA3-CreatorID
>>           ...
>>           AppAB1-CreatorID
>>           AppAB2-CreatorID
>>           AppAB3-CreatorID
>>           ...
>> 
>>       I've been thinking about doing a "prefix-sufix" management of
>>       all my data, but I don't want them to be "visible" for the user.
>>       How can I proceed?
>> 
>>           Thank you a lot!
>> -- 
>> Best regards,
>>  Jose Rodriguez Ruibal
>> 
>> NIT (Nomad Information Tech)
>> e-mail: mailto:[EMAIL PROTECTED]
>> 
>> 
>> 
>> -- 
>> For information on using the Palm Developer Forums, or to unsubscribe, please see 
>http://www.palmos.com/dev/tech/support/forums/
>> 


RC> --
RC> Roger Chaplin
RC> <[EMAIL PROTECTED]>



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