Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to handle multi-user?
Message
De
18/11/1997 12:07:13
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00060743
Message ID:
00060955
Vues:
36
>>>After making the jump from FoxPro 2.5 to VFP5 I am starting to understand the aspects of buffering and data sessions. In 2.5 I simply used RLOCK() for record locking. If .T. SHOW GETS ENABLED, if false then a message stating that the record is being edited by another user. In VFP my form's DataSession is set to 2-Private and the BufferModeOverride of my cursor in the DE is set to Pessimistic Record Locking. How do I implement the same type of record lock checking in this situation.
>>
>>Hi Colin,
>>
>>The others have all provided good answers and as you can see, they can be quite varied. I've had to do an app with the same requirements, pessimistic buffering
>>and wanting to let a user know that a record is locked. As you've undoubtedly found out, a record retrieved by a user with pessimistic buffering on does not lock that record until they attempt to modify it. I found this rather lacking and my requirements specifically stated that a second user was not to be able to begin editing if the record was in use by another. So I do have a combination of private datasessions, pessimistic buffering and also make use of RLOCK(). When a record is retrieved for editing, I attempt to gain a lock on it. If that user gets the lock, then they have it. If they don't get the lock, I set the .Enabled properties to .F. The user can view the data but cannot change it. It seems to be working fine.
>>
>>Steve Despres
>
>I tried doing this and by putting the following in the .Click of my Edit button:
>
>IF RLOCK()
> && Enable=.T. for objects and .SetFocus to first object
>ELSE
> =MESSAGEBOX("Record is being edited by another user.",(0+48+0),"Cannot Edit")
> RETURN
>ENDIF
>
>If I run 2 instances of the form in VFP this code works perfectly. However, when running the .EXE, if a user chooses to edit a record already LOCKed the locks up instead of showing the message. When the first user UNLOCK's the record the other users form becomes active again and is in edit mode. Am I missing a setting or something?

Sounds like you are forgetting to set REPROCESS. Remember that like other data settings, REPROCESS is scoped to the current datasession.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform