Thanks. I have a new question I am getting the
following error
Error : function call 'DmSet(void *, unsigned long,
unsigned long)' does not match
'DmSet(void *, unsigned long, unsigned long, unsigned
char)'
Starter.cpp line 249 DmSet( rec, sizeof( *rec ), 0
);
Heres my code;
{
DmOpenRef dbRef;
dbRef = OpenRecordDatabase(DBNAME, CREATORID,
DBTYPE);
UInt16 at = dmMaxRecordIndex;
MemHandle h = DmNewRecord( dbRef, &at, sizeof(
MyRecord ) );
MyRecord *rec = (MyRecord *) MemHandleLock( h );
DmSet( rec, sizeof( *rec ), 0 );
MemHandleUnlock( h );
DmReleaseRecord( dbRef, at, true );
}
--- Raymond Ochoa <[EMAIL PROTECTED]> wrote:
> 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/
__________________________________________________
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/