>>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>
use (laNewTables[m.lnI,1]) exclusive in 0 alias NewData zap etcNewData is never SELECTed so unless there is no file open in the current workarea, the wrong file will be zapped and appended to.