Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to see if file can be used exclusive w/o causing err
Message
From
16/08/2000 09:58:45
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00405024
Message ID:
00405473
Views:
18
Hi Larry,
I don't think all this ON ERROR Failed=.T.--Reset the Error Handler is the way to go. I would do this:
oUse = NEWOBJECT("UseTable", "Data.VCX")
WITH oUse
   .Alias = "Employee"
   .UseClause = 'EXCLUSIVE'
   RetVal = .Open()
ENDWITH
RETURN m.RetVal
You know if the Open returns False, the file was not opened. You can
then get oUse.ErrorMessage to display the reason, if it's important.

This class has it's own error method to let us know about a failed USE. It knows how to determine the path. One reaon for OOP is we code once, really well, and re-use the functionality. Everytime I use a table, I can control the situation without too much thought. I need that!
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform