Hello,
This is my code.
DmOpenRef dbRef;
Char LineB[20];
UInt16 RecordNr;
MemHandle recordH;
char * RecordPtr;
int offset;
dbRef = DmOpenDatabaseByTypeCreator('DATA', 'AlfA', dmModeReadWrite);
RecordNr = 0;
recordH = DmGetRecord( dbReff, RecordNr);
RecordPtr = MemHandleLock( recordH );
if (DmGetLastErr()){
char * handleP=0;
return DmGetLastErr();
}
StrCopy(LineB, RecordPtr);
-------------------------------------------------
LineB contains now: Flower10
Change LineB to Flower15 (keep the record the same size)
I like to write LineB back to the record
-------------------------------------------------
DmWriteCheck(RecordPtr, LineB, sizeof( LineB));
if (DmGetLastErr()){
char * handleP=0;
return DmGetLastErr();
}
-------------------------------------------------
So far all well, no error.
-------------------------------------------------
offset = 0;
DmWrite(RecordPtr, offset, LineB, sizeof(LineB));
-------------------------------------------------
Now I get a fatal Alert
DataMgr.c line: 7025
DmWrite: DmWriteCheck failed
What do I wrong in DmWrite( )?
-------------------------------------------------
to complete the code:
MemHandleUnlock( recordH);
DmReleaseRecord(dbReff, RecordNr, true);
-------------------------------------------------
Can somebody help me, please.
CDJ
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/