Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If statement to check for exclusive?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01308043
Message ID:
01308046
Vues:
15
>I am trying to simply set up a messagebox to tell other users that administrators are currently working on the database rather than having that error message come up to tell them that access is denied. Is there simply a way to set up an if statement at the beginning of the start code to check to see if exclusive is set, then send out a message box? Or is there another way that you know of to do this?
>
>I have tried to set up an m variable (i.e. flag) in this update code that would go to true when it starts and false when it ends. I then set an if statement in the start code to check to see if it is set to true or false. However, it does not recognize the public m variable that the other program has set. Any thoughts?
LOCAL llExclusive, ;
      loEx AS Exception

llExclusive = .F.

TRY
   USE SomeTable IN 0 AGAIN
CATCH TO loEx
   llExclusive = .T.
ENDTRY

IF llExclusive
   * Table is being used exclusively.
ENDIF
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform