Is your record in the database (record) the correct length. The size of
RecType is 100 bytes, but you say the records are 80 bytes long. The DmWrite
is failing on the extra 20 bytes.

Dominique

"Dave Mottorn" <[EMAIL PROTECTED]> wrote in message
news:114317@palm-dev-forum...
>
> Can anyone see what's wrong here?  I'm trying to update a record - both
the
> old and new records are character strings about 80 bytes long.  I'm
getting
> a DmWriteCheck error.
>
>   typedef struct {
>   char field[100];
> } RecType;
> RecType temprecord;
> RecType *record;
> VoidHand RecHand;
> LocalID dbID;
> DmOpenRef TranDB;
>
> MakeSumFileName(currentjob);
> StrCopy(temprecord.field, tranbuf);
> dbID = DmFindDatabase(0, sumfile);
> if (dbID){
> TranDB = DmOpenDatabase(0, dbID, dmModeReadWrite);
> RecHand = DmGetRecord(TranDB, sumfilerecno);
> record = MemHandleLock(RecHand);
> temprecord = *record;
> StrCopy(temprecord.field, tranbuf);
> DmWrite(record, 0, &temprecord, sizeof(temprecord));
> MemHandleUnlock(RecHand);
> DmReleaseRecord(TranDB, 0, false);
> DmCloseDatabase(TranDB);
> }
>
> regards,
>
> Dave Mottorn
>
>
>
>



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

Reply via email to