Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If statement to check for exclusive?
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01308043
Message ID:
01308046
Views:
16
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform