Here is the batch file. I am doing a query to table because I only need two columns in the tables to a new DBF. Then I am trying to export those temporary DBF's to Excel. DBF's are FoxPro I believe.
- Code: Select all
@echo off
cd "\Program Files (x86)\DBFCommander"
dbfcommander.exe -q "SELECT inv,name FROM 'c:\path\to\file.dbf' WHERE (thedate>=DATE()-15) INTO TABLE c:\path\to\open.dbf'"
dbfcommander.exe -q "select inv,name from 'c:\path\to\file2.dbf'' INTO TABLE "c:\path\to\inv.dbf'"
dbfcommander.exe" -e "c:\path\to\open.dbf" "c:\path\to\Export\open.xls"
dbfcommander.exe" -e "c:\path\to\inv.dbf" "c:\path\to\Export\inv.xls"
exit
I started out with this on a Windows 7 machine and everything worked fine. Once I moved it to Server it worked manually. When I ran it as a scheduled task it fails completely and does not create the DBF's or XLS's.
Now when I run it manually on the server it will create the DBF's but gives me this error for creating the XLS:
- Code: Select all
Error: Access violation at address 0061C610 in module 'DBFCommander.exe'. Read of address 000003A0