Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is table already open under diff alias?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01448039
Message ID:
01448045
Views:
66
>>Hi,
>>
>>The only way I know how to determine if a table is already open under some unknown alias is by trying to open the table exclusive and catching the error. Is there another way, maybe simpler?
>>
>>TIA.
>
>
>TRY
>  USE YourTable IN 0 EXCLUSIVE
>CATCH
>  MessageBox("The Table is already opened somewhere")
>ENDTRY
>
Thank you, Borislav. This works but I forgot to mention that I am trying to find out if the file/table is open by "this" user and not by anyone. That is, if another user of this application has this file open (maybe on another computer), the above code will say that the file is already open. But to me this is not important; I need to find out if this datasession has the file open. Do you see what I mean?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform