--- "c.d. jansen" wrote:
>
> DmOpenRef dbRef;
> MemHandle recordH;
> UInt16 RecordNr;
> char * recordPtr;
> Char Regel[120];
>
> dbRef = DmOpenDatabaseCreator('DATA', 'AlfA', dmModeReadWrite);
> recordH = DmQueryRecord(dbRef, RecordNr);
Did you initialize RecordNr anywhere?
> recordPtr = MemHandleLock(recordH);
DmQueryRecord() returns a record handle. If an error occurs, it
returns
NULL, and DmGetLastErr() returns an error code indicating the reason
for the failure. Why aren't you checking that before you lock the
handle?
> StrCopy (Regel, recordPtr);
> MemHandleUnlock(recordH);
> DmReleaseRecord(dbRef, RecordNr, true);
> ...
> When I replace DmQueryRecord by DmGetRecord (I need to use
> the last), I get a error right after that code.
What error?
DmGetRecord() returns a handle to record data. If another call to
DmGetRecord() for the same record is attempted before the record is
released, NULL is returned and DmGetLastErr() returns an error code
indicating the reason.
> What do I wrong or what do I forget?
Note that DmGetRecord marks a record busy but DmQueryRecord doesn't.
So, DmGetRecord can fail in cases where DmQueryRecord will succeed.
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/