Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening files..
Message
 
 
À
06/08/2007 20:30:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01246351
Message ID:
01246355
Vues:
22
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform