Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If file is used by another exclusively
Message
 
To
13/11/2008 21:12:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01361833
Message ID:
01361872
Views:
19
Randy,

I know of no way you can find out if the other user has the file exclusively, but you can find out inf anyone else has the file open;
* Save error handler
lcOnError = ON("ERROR")

* Set on error to find out if you get the file open
ON ERROR llError = .t.
llError = .f.

* Attempt to use the file exclusively
USE TheTable EXCLUSIVE

* Restore the error handler
ON ERROR &lcOnError

IF llError
  * Someone else has it in use

ELSE
   * It is not in use by anyone else but is now yours exlcusively

ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform