Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending from several tables
Message
De
19/04/2007 16:38:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01217264
Message ID:
01218037
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
>Naomi
>
>About your code
>
>I used the code to append from .DBFs of former folder
>and it worked fine
>
>But in another folder which has less tables, a message appears after
>processing some tables:
>
>"Subscript is outside defined range"
>
>Do you think that's because the folder has less .dbf files,
>and have to do with the number of tables inside the array ?

Here's a similar approach that won't try to append to/from files that don't exist
lcAppendIntoPath = ADDBS(myIntoPath)
lcAppendFromPath = ADDBS(myFromPath)
lnNumTables = ADIR(aTables,lcAppendFromPath+"*.dbf")
SELECT 0
FOR I = 1 TO lnNumTables
	TRY
		USE (lcAppendIntoPath+aTables[i,1] EXCLUSIVE
		ZAP
		APPEND FROM (lcAppendFromPath+aTables[I,1])
	CATCH
		=MESSAGEBOX("Cannot open "+lcAppendIntoPath+aTables[I,1])
	ENDTRY
ENDFOR
USE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform