Try 

#define DBNAME    "Data_for_JOHN"

instead of 

#define DBNAME    'Data_for_JOHN'

The function takes a char * as a name



-----Original Message-----
From: Johnathan Smith [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 4:54 PM
To: Palm Developer Forum
Subject: Error opening database


I am getting the following error trying to open the
database

Error   : illegal character constant
Starter.cpp line 356   'Data_for_JOHN'

Here my code:
#define CREATORID 'JOHN'
#define DBTYPE    'DATA'
#define DBNAME    'Data_for_JOHN'

static Err AppStart(void)
{
    StarterPreferenceType prefs;
    UInt16 prefsSize;

        // Read the saved preferences / saved-state
information.
        prefsSize = sizeof(StarterPreferenceType);
        if (PrefGetAppPreferences(appFileCreator, appPrefID,
&prefs, &prefsSize, true) != 
                noPreferenceFound)
                {
                }
        
        
    UInt16            mode = dmModeReadWrite;
    
    DmOpenRef            dbRef;
   //PrefGetPreferences( &prefs );
    
    dbRef = DmOpenDatabaseByTypeCreator( DBTYPE,
CREATORID, mode );
    if( !dbRef ){
        Err err = DmCreateDatabase( 0, DBNAME ,
CREATORID , DBTYPE, false );
        if( err != 0 ) return err;
    
     dbRef = DmOpenDatabaseByTypeCreator( DBTYPE,
CREATORID,  mode );
    }


   return errNone;
}



__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/

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