Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't get a record to lock?
Message
De
16/10/2000 07:15:32
Raymond Humphrys
Michigan Department of Community Health
Bath, Michigan, États-Unis
 
 
À
16/10/2000 02:48:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00429650
Message ID:
00429699
Vues:
17
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 ...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform