Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening files..
Message
 
 
To
06/08/2007 20:30:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01246351
Message ID:
01246355
Views:
21
>Anyone have an idea how I can open files from a directory and append them to a table programatically? Filenames are unknown at run-time.
>
>TIA.

Do the files have the same structure?

Try
on error ReportError(error(), message())

use myMainTable in 0 alias MainTable
lnFiles = adir(laFiles, m.lcMyDir + '*.dbf') && assuming we're working with DBFs
for lnI = 1 to m.lnFiles
    use (m.lcMyDir + laFiles[m.lnI,1]) in 0 alias WorkFile
    select MainTable
    append from dbf('WorkFile')
    use in select('WorkFile')
next
Add an error routine.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform