>SET PATH TO E:\IRL\SHIP >lnFileHandle=FOPEN("E:\IRL\SHIP\ORDERS.DBF", 12) >IF lnFileHandle <> -1 && File is open. > =FCLOSE(lnFileHandle) && Close at low-level immediately. > WAIT WINDOW NOWAIT "Zapping records from ORDERS table..." > USE E:\IRL\SHIP\ORDERS EXCLUSIVE IN 0 > SELECT ORDERS && 10/29/2004. Cecil Champenois. > ZAP >ELSE > lcMessageText="" > lcTitleBar="" > MESSAGEBOX(lcMessageText, 0+64, lcTitleBar) >ENDIF >WAIT WINDOW NOWAIT ; > "Appending records from the I:\DIV_04\Daily\OE531S_4.XLS" + ; > + chr(10) + chr(13) + ; > "spreadsheet into the E:\IRL\SHIP\ORDERS table..." >IF FILE("I:\DIV_04\Daily\OE531S_04.XLS") > APPEND FROM I:\Div_04\Daily\OE531S_04.XLS TYPE XLS > USE >ELSE > *** You've got to close this here. It is used further down the chain. > SELECT ORDERS > USE > lcMessageText="File: I:\DIV_04\Daily\OE531S_04.XLS not found." > lcTitleBar="File not found!" > MESSAGEBOX(lcMessageText, 0+64, lcTitleBar) >ENDIF >