If you don't have a file to append from, you don't need to open the other table exclusive, in other words, move the check at the top and USE the table only if the file exists. I made the code changes inside your code.
BTW, this sounds like a much simpler solution than the one I originally invented <g>
>Thank you
>
>I changed the orgin and destiny path and also added:
>
>****IF file (lcAppendFromPath+aTables[i,1]) ***
>
>So it will try to append only if the file exists
>
>Moises
>
>
>FOR I = 1 TO lnNumTables
IF file (lcAppendFromPath+aTables[i,1])
TRY
> USE (lcAppendIntoPath+aTables[i,1]) EXCLUSIVE
> ZAP
>
> APPEND FROM (lcAppendFromPath+aTables[i,1])
catch
endtry
endif
>endif
If it's not broken, fix it until it is.
My Blog