Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending from several tables
Message
From
19/04/2007 16:38:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01217264
Message ID:
01218037
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform