Preempt this problem by putting in an attempt to lock the record - RLOCK(). If RLOCK() fails then just issue message like "Locked by another user"
>in the transaction, I used an 'Update' button, if the user clicks that button, it will update all the files:
>
>lOkay=.n.
>BEGIN TRANSACTION
>SELECT vinv
>IF TABLEUPDATE(.t.) AND GETNEXTMODIFIED(0)=0
> SELECT vinvdetail
If not RLOCK()
WAIT WINDOW "sorry etc."
Else
> IF TABLEUPDATE(.t.) AND GETNEXTMODIFIED(0)=0
> SELECT scard
> IF TABLEUPDATE(.t.) AND GETNEXTMODIFIED(0)=0
> lOkay=.y.
> ENDIF
> ENDIF
EndIf not RLOCK()
>ENDIF
>
>IF lOkay
> END TRANSACTION
>ELSE
> ROLLBACK
> WAIT WINDOW 'Rollback, big problem'
>ENDIF
>
>but if two users click the button at the same time, one will get the Rollback message. any solution for that?
>
>thanks for the help
>
>regards,
>
>Jerry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.