Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record locking
Message
 
À
07/06/2005 08:57:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01020833
Message ID:
01020869
Vues:
23
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform