Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is table already open under diff alias?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01448039
Message ID:
01448209
Vues:
48
>>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>).

To check if the certain table is opened in the particular DS you need to use aUsed() function.

John's alternative (of trying to open a table under some weird alias and close and catch the error) should work as well.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform