Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking

Status
Not open for further replies.

itflash

Programmer
Jul 18, 2001
535
GB
Hi

I lock a record in a table (alias 5) with rlock().

Then I do the following code in a form to check no one is editing another record.

select 5
seek val(thisform.contractselect.value) order tag contractid
if found()
if rlock() = .t.
unlock record recno() in 5
endif
endif

However, this recently has stopped working.
Anyone know why?

I just do not know why. :p Please help.


 
update->

only happens when I lock one record in alias 5, then try to lock an additional record in alias 5.

Seems to get lost somehow.
 
Hi itflash,
I don't understand what you meant by However, this recently has stopped working. That is what you really want to do with this piece of code.
It seems to me that this code will seek a particular record and then try to lock it. And if it is able to lock it then unlock it.
By the way, if you want to place lock on multiple rows then please Check the status of MULTILOCKS. OR issue SET MULTILOCKS ON in the starting of application. Remember, If you issue set multilocks on or off in middle of locking, then, all record locks in all workareas are released.
 
Thanks for the reply.

Yes, i want to lock the record, then unlock it.
However, this is not working.
I have set Multilocks on in my startup.

Thanks

 
Are you using private datasessions? MULTILOCKS is one of the many settings that is reinitialized for each DataSession. See the help topic "SET DATASESSION Command" for a list of these.

Rick
 

See my other post -> Locking and Transactions.

Thanxs for the replies.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top