Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I check if a dbf is already open?
Message
From
14/03/2016 10:43:00
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01632847
Message ID:
01633025
Views:
55
>>>>>>>>>How do I check if a dbf is already open?
>>>>>>>>
>>>>>>>>Do you mean by the current user, or by other users?
>>>>>>>
>>>>>>>Both
>>>>>>>
>>>>>>>Most important though is Current User
>>>>>>
>>>>>>See my updated reply.
>>>>>
>>>>>Where is your updated reply? I cant see it
>>>>
>>>>Can't you see it if you refresh my first reply? Anyway, this is what I added: For the current user, see Used() and Aused() in help. For other users, try to open the dbf exclusive.
>>>
>>>I am working on this same issue as well in an old legacy app. Can you tell me how you handle to trap this if in fact the file is open by another user when you test it with opening the dbf with exclusive?
>>
>>Simple.
>>
llOK = .T.
>>try 
>>   use myTable Exclusive
>>catch to loexception
>>   llOK = .F.
>>   messagebox( 'Someone else is using the table!')
>>endtry
>
>OK, that sounds like what I need.... thanks for this.

You're welcome.
Previous
Reply
Map
View

Click here to load this message in the networking platform