Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't get a record to lock?
Message
From
16/10/2000 07:15:32
Raymond Humphrys
Michigan Department of Community Health
Bath, Michigan, United States
 
 
To
16/10/2000 02:48:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00429650
Message ID:
00429699
Views:
18
I pulled your code directly into my application and I still can't get a record
to lock. When you use RLOCK how long do the locks stay in place? How can I be sure that all locks are released when I want them to be? Do different buffering schemes influence the ability to lock a record?

thanks

>>I can not get the following code to lock a record. What can can cause this failure? I've got multilocks on, and reprocess set to automatic for testing.
>>
>>STORE recno() to gcreclist2
>>DO WHILE NOT RLOCK('myfile')
>> RLOCK(str(gcreclist2), 'myfile') &&& Lock clinical record
>> IF NOT RLOCK()
>> Wait window "Somebody else is working on this record"
>> ELSE
>> UNLOCK
>> ENDIF
>>ENDDO
>>
>>thanks
>
>It looks like your default work area is "MyFile", and the record pointer is already on the record you want to lock. You don't need to go through that many gyrations:
LOCAL llLocked
>llLocked = .F.
>
>DO WHILE NOT llLocked
>  IF RLOCK("MyFile")
>    llLocked = .T.
>
>  ELSE
>    WAIT WINDOW "Couldn't Lock Record !"
>
>  ENDIF
>
>ENDDO
>
>UNLOCK IN MyFile
Some days it's not worth chewing through the leather straps ...
Previous
Reply
Map
View

Click here to load this message in the networking platform