Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending from several tables
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01217264
Message ID:
01218465
Views:
15
You need to use a loop on AppendInto not on AppendFrom. In other words, change in your adir to
lnNumTables = ADIR(aTables,lcAppendIntoPath+"*.dbf")
and it would work.

>Rich
>
>You code is good and appends from tables of the old folder
>to all tables of the new folder
>
>However I notice that if there is a table present only in the old
>folder that is not present in the new folder it will try to append
>
>How can I skip the code from processing tables that only exist
>on the old folder ?
>
>
>
>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
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