Begin Transaction & End Transaction

Begin Transaction & End Transaction

Post by Debbi » Sun, 03 Apr 2005 08:59:55


I have a problem deleting records during a Begin and End Transaction.
Basically this is what is happening:

If User1 is viewing a record in MYTABLE at the same time that User2 runs a
procedure to delete a batch of records from MYTABLE then all the records get
deleted except for the one that User1 was looking at. I have tried
including the following code, but it makes no difference!

SELECT mytable
SCAN
IF EXP1 = EXPR2
DO WHILE !RLOCK("mytable")
LOOP
ENDDO
DELETE IN mytable
TABLEUPDATE(0,.T.,"mytable")
UNLOCK IN mytable
ENDIF
ENDSCAN

Could someone please tell me where I am going wrong?

Many thanks - Debbie