I have been reading up some more on related topics... i may have an alternative method to get this done. Instead of using one .cmd script designed to run within the db2 command prompt, i am experimenting with using two scripts:
initdb2.cmd
-------------------------
db2cmd -c -w -i %1.bat %2
-------------------------
runreport.bat
-------------------------
if "%1" == "" goto noparm1
set Date=%1
db2 connect to <db> user <uid> using <pwd>
db2 -x "select amount, chargeaccountnum, date(decisiontimestamp) from <table> where date(decisiontimestamp)='%Date%' and chargeaccountnum='001845969' and substr(captureseqnum,1,3)='003' and substr(depositaccountnum,1,3)='001' order by amount desc" >> c:\temp\eeHousehold\hh.txt
db2 disconnect <db>
goto exit1
:noparm1
echo error!
:exit1
-----------------------
when i call:
prompt>initdb2 runreport 10/25/2007
from a standard cmd prompt, this works perfectly.
i have not been able to figure out a way to get this to run when called from VBA. I changed the Exec call to:
Code:
Set objExecObject = objShell.Exec("%comspec% /c \\homeserver\shared\AcctSvcs\Jake\initdb2.cmd runreport " & sInput)
When i run this code, a cmd window opens and closes, but nothing else happens.
Any ideas? Thanks!