loosing record pointer upon update

Robert Brenstein rjb at rz.uni-potsdam.de
Sun Feb 16 13:36:04 CST 2003


Select recid,* from boname where recid=0

cursor_getrecordcount -> 0
cursor_setfield,"timestamp",secs() ->
cursor_addrecord -> true
cursor_getfield,"recid" -> 129

Works fine. However, this keeps adding new records. Since I now 
accumulated some abandoned records (user started entry but did not 
finish), I try to reused them

Select recid,* from boname where rid=0

rid is my field that is 0 if record is abandoned and is set to recid 
when user completes transaction.

cursor_getrecordcount -> 66
cursor_firstrecord -> true
cursor_setfield,"timestamp",secs() ->
cursor_updaterecord -> true
cursor_getfield,"recid" -> 0

Why but WHY do I get 0 as record id  ???

If I copy the cursor_getfield call before update, it works correctly, 
so there is no type or other problem.

Select recid,* from boname where rid=0
cursor_getrecordcount -> 66
cursor_firstrecord -> true
cursor_getfield,"recid" -> 1 <=== !
cursor_setfield,"timestamp",secs() ->
cursor_updaterecord -> true
cursor_getfield,"recid" -> 0 <=== !

If I insert setting record after update, then all is fine again.

Select recid,* from boname where rid=0
cursor_getrecordcount -> 66
cursor_firstrecord -> true
cursor_setfield,"timestamp",secs() ->
cursor_updaterecord -> true
cursor_firstrecord -> true
cursor_getfield,"recid" -> 1

No errors at any time. This is with vxcmd 1.9.6 btw.

It sure looks that UpdateRecord causes cursor to firget its record pointer.

RObert Brenstein


More information about the Valentina mailing list