Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open all tables in a directory

Status
Not open for further replies.

choppysuey

Technical User
Mar 28, 2001
54
US
Hey everyone, I was interested in getting some sample code on how to get VFP6 to loop through and open all dbf files in a directory like 'c:\vfptables'. Currently I have the table names in an array and loop through that to open the tables I need. I think this is the hard way of doing it.

-suey
 
Suey,

Currently I have the table names in an array and loop through that to open the tables I need. I think this is the hard way of doing it.

On the contrary. That seems to me to be the easiest way of doing it. In other words:

- Use ADIR() to get the list of files

- Loop through ADIR, using each table in turn.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Using an array is probably the most efficient method of processing a list of tables. I use that method all the time. If the list of files is not static, you can use the ADIR() function to populate the array.

Mike Krausnick
Dublin, California
 
Thanks guys for setting me straight. For some reason I had it in my head that there was an easier way in VFP then using the ADIR() function and t0hen doing the loop.

-suey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top