Hi,
    After entering some records...say 5 then u close ur application and then ur able 
to read the database back when u invoke ur
application again?

-Peter

reshma wrote:

> struct myrec
> {
> char *test;
> };
>
> myrec *rec,record;
>
> dbref=DmOpenDatabaseByTypeCreator(DBTYPE,CREATORID,dmModeReadWrite);
>          if(!dbref)
>             FrmCustomAlert(DummyAlert,"error","","");
>         field1= (FieldPtr) GetObjectPtr(AddrecIDField);
>         record.test=FldGetTextPtr(field1);
>         FrmCustomAlert(DummyAlert,record.test,"","");
>         UInt16 at=dmMaxRecordIndex;
>         VoidHand q= DmNewRecord(dbref,&at,sizeof(myrec));
>         rec=(myrec *) MemHandleLock(q);
>         DmWrite(rec,0,&record,sizeof(record));  // i have doubt in this
> statement ie; specifying offset as zero
>         MemHandleUnlock(q);
>         DmReleaseRecord(dbref,at,true);
>         DmCloseDatabase(dbref);
>
> i am using this code and i feel that its overwriting the existing record
> even though i have opened the database using
> dmModeReadwrite mode.please suggest if any corrections to be made.
> please anybody give me code snippets to append , modify and delete records
> from a database.
> and also for reading records one by one till end of file.
>
> regrds
> reshma
>
> --
> 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