Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
USED() function returns .F. but table is open?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00861974
Message ID:
00862265
Vues:
16
>>This is probably a fairly basic level question, but here goes...
>>Occasionally I will encounter a situation where the Used() function will return .f. for a table/cursor being in use, but attemting to then use the tested table fails with a "file is in use" error. The problem is intermittent.
>>What would cause this to occur?
>>TIA,
>>Margaret
>
>Are you testing for Used() in code called from a Form with a Private DataSession, this will cause Used() to return .F. if the table is open in a different data session.


I concur. Multiple datasessions make the used() function more difficult to implement. The quick and dirty solution might be to encase the used() function is some code like this:

IF !USED('mytablealias')
USE mytable ALIAS 'mytablealias' IN 0
ENDIF


Let the other datasession keep control of it's copy and use it in this datasession again for it's own purposes... Just a thought.
Steven D. Supinski
The American Contractor
Santa Cruz, CA 95062
Phone: (800) 333-8435 ext 4017
Email: ssupinski@theamericancontractor.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform