Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close all tables opened in a routine?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01310216
Message ID:
01310220
Vues:
24
This message has been marked as the solution to the initial question of the thread.
OR
AUSED(laCurrAliases)

*-- Execute a Sql Select that opens one or more tables
*** select * from mytable1 join mytable2 .. join mytable3.. etc.

lnallAliases = AUSED(laArr)

FOR lnLoop = 1 TO m.lnallAliases
    IF ASCAN(laCurrAliases,m.laArr[m.lnLoop,1])# 0
       LOOP
    ENDIF
    USE IN (m.laArr(m.lnLoop,1))
NEXT
>Thank you, Vladimir.
>
>>Try this:
>>
*-- bookmark selected area
>>lcSelect = ALIAS()
>>
>>*-- Execute a Sql Select that opens one or more tables
>>*** select * from mytable1 join mytable2 .. join mytable3.. etc.
>>
>>lnOpenDbfs = AUSED(laArr)
>>
>>FOR lnLoop = 1 TO m.lnOpenDbfs
>>
>>    IF m.laArr[m.lnLoop,1] = m.lcSelect
>>       LOOP
>>    ENDIF
>>
>>    USE IN (m.laArr(m.lnLoop,1))
>>NEXT
>>
>>
>>>Good morning,
>>>
>>>I would like to find a way to close all tables that are opened in a routine.
>>>
>>>Here is an example.
>>>
>>>
>>>*-- bookmark selected area
>>>nSelect = select()
>>>
>>>*-- Execute a Sql Select that opens one or more tables
>>>select * from mytable1 join mytable2 .. join mytable3.. etc.
>>>
>>>*-- Close all tables opened in the above SQL Select.
>>>
>>>*-- I believe I need to know the highest SELECT() at this
>>>point and scan it backwards until coming to nSelect.
>>>But how to determine currently highest SELECT()?
>>>
>>>
>>>
>>>Or if you think or can suggest a better method to accomplish it, I would appreciate it.
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform