Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending from several tables
Message
From
19/04/2007 18:02:10
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01217264
Message ID:
01218068
Views:
19
>>Naomi
>>
>>The code is just as below
>>Do you think it's able to append from tables of
>>an old folder to a new folder, even if the new folder has
>>more tables than the older one ?
>>
>>lnOldTables = adir(laOldTables, MyOldPath + "*.dbf")
>>lnNewTables = adir(laNewTables, MyNewPath + "*.dbf")
>>
>>for lnI = 1 to lnNewTables
>>   lnRow = ascan(laOldTables, laNewTables[m.lnI,1],1,-1,1,15)
>>    if lnRow > 0
>>    wait window timeout 2 "Importing from file " + laOldTables[m.lni,1]
>>         use (laNewTables[m.lnI,1]) exclusive in 0 alias NewData
>>         zap
>>         append from (myOldPath + laOldTables[m.lnRow,1])
>>         use in NewData
>>  endif
>>NEXT
>
>I don't see a bug here, so I think it should work.

Am I missing something here????
use (laNewTables[m.lnI,1]) exclusive in 0 alias NewData
zap
etc
NewData is never SELECTed so unless there is no file open in the current workarea, the wrong file will be zapped and appended to.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform