Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record locking
Message
 
To
07/06/2005 08:57:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01020833
Message ID:
01020869
Views:
24
>I want to lock a record in the table "leden". But if it's already locked by another user the program must give a message that the record is already locked. The user must wait until the first user is finnished. The when the first user is finnished the record must be unlocked again.
>
>Thanks,
>Ron
*** If this is a PRG function or procedure
IF NOT RLOCK("....") && Forgot the name of the table :o)
   MessageBox("The record is already locked", 64,"Record Lock")
   RETURN
ENDIF

....

*** Do Your code

UNLOCK IN ....   && See my comment on the first line :o))



*** IF you want this in FORM
** In INIT Event of the form
IF NOT RLOCK("....")
   MessageBox("The record is already locked", 64,"Record Lock")
   RETURN .f.
ENDIF


** In DESTROY event of the form
UNLOCK IN ....   && See my comment on the first line :o))
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform