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/