TallGuyinIT
IS-IT--Management
Can someone help me with the best practice in locking a record while updating? I am trying to update an existing program that occasionally does not update the record. I have looked at other existing programs and the Microsoft knowledge base. There are several options. I am trying to determine which one is best practice, or is there even a better way.
Option 1 (existing code)
SET REPROCESS TO 0
SEEK (locate the record)
IF RLOCK()
*Code to update record
UNLOCK
ENDIF
Option 2 (other programs on our system)
SET REPROCESS TO 0
SEEK (locate the record)
DO WHILE RLOCK()
ENDDO
*Code to update record
UNLOCK
Option 3 (microsoft)
SET REPROCESS TO 0
SEEK (locate the record)
?RLOCK()
*Code to update record
UNLOCK
Any opinions or other options?
Option 1 (existing code)
SET REPROCESS TO 0
SEEK (locate the record)
IF RLOCK()
*Code to update record
UNLOCK
ENDIF
Option 2 (other programs on our system)
SET REPROCESS TO 0
SEEK (locate the record)
DO WHILE RLOCK()
ENDDO
*Code to update record
UNLOCK
Option 3 (microsoft)
SET REPROCESS TO 0
SEEK (locate the record)
?RLOCK()
*Code to update record
UNLOCK
Any opinions or other options?