Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is table already open under diff alias?
Message
 
 
To
08/02/2010 15:07:05
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01448039
Message ID:
01448203
Views:
53
>Dmitry,
>
>Forgive me if I have the wrong end of the stick, but if a table already is open in your datasession, won't another attempt to USE it even with a different alias throw a "file is in use" error? Don't you have to use the AGAIN clause if you want to open it again?
>
>IOW all you have to do is USE your table and CATCH the "file in use" error if it's already open. If it is already open under a different alias from the one you want, you can USE AGAIN to open it with the alias you want.

John,

I have a generic routine that updates several tables based on some criteria. After this routine/procedure is finished it closes the tables. I want to check if a certain table is open - at the top of this procedure - and set a flag so that this table is not closed (or it will break some other parts). The "generic" routine does not know the alias name assigned to the table. This is why I needed to have a method to find out if a table is opened. If the generic routine ran in its own datasession it would not be a problem but this is not the case.

I hope this explain what I am doing (at least I am beginning to understand <g>).
"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