Steve-vfp9user
Programmer
Hello
I have set up a home network to test a multi user app I am trying to deveop. I have a problem with RLOCK()
The following code has been placed in a prg to access a table:
No problem with the above code which works perfectly.
I have the same code in another prg the same as above but to update a record in a different table as below:
This doesn't work and allows the same record to be opened by two users on different computers at the same time.
I also tried removing the =.F. after the RLOCK() command but this just locks the record straight away.
There are multiple threads on this forum relating to RLOCK() and the VFP help file doesn't give too much away. I can't find the answer to my question so any assistance or guidance would be much appreciated.
Using: Windows 10 / Visual FoxPro 9 with SP2
Thank you
Steve
I have set up a home network to test a multi user app I am trying to deveop. I have a problem with RLOCK()
The following code has been placed in a prg to access a table:
Code:
USE mytable1 SHARED
GO mpurchrec && Where mpurchrec is the RECNO()
SET REPROCESS TO 3
IF RLOCK()=.F.
=MESSAGEBOX("The Order you are trying to access is being updated by another user"+SPACE(10), ;
0+64+0,"System Message")
RETURN
ENDI
No problem with the above code which works perfectly.
I have the same code in another prg the same as above but to update a record in a different table as below:
Code:
USE mytable2 SHARED
GO mjobrec && Where mjobrec is the RECNO()
SET REPROCESS TO 3
IF RLOCK()=.F.
=MESSAGEBOX("The Job you are trying to access is being updated by another user"+SPACE(10), ;
0+64+0,"System Message")
RETURN
ENDI
This doesn't work and allows the same record to be opened by two users on different computers at the same time.
I also tried removing the =.F. after the RLOCK() command but this just locks the record straight away.
There are multiple threads on this forum relating to RLOCK() and the VFP help file doesn't give too much away. I can't find the answer to my question so any assistance or guidance would be much appreciated.
Using: Windows 10 / Visual FoxPro 9 with SP2
Thank you
Steve