I am working on a palm program that needs access to
more then one database at a time.  If I try using diff
databse names with the following code the program uses
the first database it find.  Then if I try to change
the database type to any thing but "DATA" I get
errors. Can someone please look at the following code
and tell me how to do it




static DmOpenRef OpenRecordDatabase( const Char *name,
 UInt32 creatorID, UInt32 type )
{
    UInt16            mode = dmModeReadWrite;
    SystemPreferencesType prefs;
    DmOpenRef            dbRef;
    PrefGetPreferences( &prefs );
    if( !prefs.hideSecretRecords ){
        mode |= dmModeShowSecret;
    }
    dbRef = DmOpenDatabaseByTypeCreator( type,
creatorID, mode );
    if( !dbRef ){
        Err err = DmCreateDatabase( 0, name,
creatorID, type, false );
        if( err != 0 ) return NULL;
    
        dbRef = DmOpenDatabaseByTypeCreator( type,
creatorID,  mode );

    }
    return dbRef;
} 



__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.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