Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open\Close all tables in directory
Message
 
 
To
15/06/2009 03:23:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01405967
Message ID:
01405998
Views:
38
Hi Chaim,

Sorry, I haven't checked all responses yet. After you opened all your tables just create an array with aused() function and then when it's time to close, use this array.

You may check Dragan's FAQ on this topic FAQ #31943

>Hi
>Help please
>
>On my form Load I have to open all tables in specific directory (That tables is free tables, not dbc) and on the form unload I have to close the tables.
>
>The following code open it but:
>1. If you run it twice the tables apeared duplicate with aliases as W15,W45 etc.
>2. 'If used... use in...' not close any table.
>
>
local ctbldir,ctabletoopen
>ctbldir= addbs('C:\DATA\')
>for i=1 to adir(lafiles, ctbldir+ "*.dbf")
>	ctabletoopen=ctbldir+ lafiles(i,1)
>	if used (ctabletoopen)
>		use in (ctabletoopen)
>	endif
>	if not used (ctabletoopen)
>		use (ctabletoopen) again in 0 shared
>	endif
>endfor
>
>Tnx
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform