closing tables opened by select-sql 
Author Message
 closing tables opened by select-sql

Is there a way to have a select-sql statement close the tables it opens
during execution? After executing a number of select statements in a
program, I am left with tens of open tables that I would like to close,
while keeping open the tables that were open initially. Any help is
appreciated.

Thanks,
Aron



Thu, 15 Jun 2000 03:00:00 GMT  
 closing tables opened by select-sql

Quote:
>> Is there a way to have a select-sql statement close the tables it

opens during execution? <<

Aron,

LOCAL i, nBefore, nAfter, nWorkArea
nBefore = AUSED(aBefore)
SELECT * <table> INTO CURSOR <cursor>
nWorkArea = SELECT()
nAfter = AUSED(aAfter)
IF nBefore > 0
    FOR i = 1 TO nAfter
       IF ASCAN(aBefore,aAfter(i,2),2) = 0 ;
       AND aAfter(i,2) != nWorkArea
           USE IN aAfter(i,2)
       ENDIF
    NEXT i
ELSE
    FOR i =  1 TO nAfter
        IF aAfter(i,2) != nWorkArea
            USE IN aAfter(i,2)
        ENDIF
    NEXT
ENDIF

*-Anders

!^NavFont02F018B000BMGJHG4DHH8C9DF6

--

12/29/97 03:23
---------
Using: OUI 1.8 Beta 7 from http://www.peaktopeak.com



Thu, 15 Jun 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Closing project manager closes open tables -why?

2. Open Tables after a Select SQL

3. Close tables opened by query ?

4. close a database and leave open a free table

5. VFP50 problems opening and closing free tables

6. Opening and closing tables

7. Automatic open and close tables

8. VFP60 DataEnvironment - Open/Close Tables

9. open table dialog even though table is open?

10. SELECT - SQL applied to remote offline view, opened online, crashes VFP 6.0 SP3

11. SELECT - SQL applied to remote offline view, opened online, crashes VFP 6.0 SP3

12. Cannot open selected table

 

 
Powered by phpBB® Forum Software