> //create a new record
> recHandle = DmNewRecord(dbRef, &maxIndex, 16);
total = "8/9/001:00 pm";
recHandle = DmNewRecord(dbRef, &maxIndex, StrLen(total) + 1);
> if (recHandle == 0)
> {
> error = DmGetLastErr();
> ErrAlert(error);
> }
>
> total = "8/9/001:00 pm";
>
> /check if the data will write successfully
> error = DmWriteCheck(&recHandle, 0, StrLen(total)); /the error comes
here
DmWriteCheck will fatal if DmWrite would. It doesn't return an error code.
> if (error != 0)
> {
> ErrAlert(error);
> return gotData;
> }
>
> /write the data into the record
> error = DmWrite(&recHandle, 0, total, StrLen(total));
You probably want:
recPointer = MemHandleLock(recHandle);
// handle the case where recPointer is NULL here...
error = DmWrite(recPointer, 0, total, StrLen(total) + 1);
// include the null terminator in the record
> if (error != 0)
>
>
> ErrAlert(error);
> return gotData;
> }
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/