This is a follow-up question to: Error in running R script in cmd window
I am still getting errors, but I switched from 64bit to 32bit R, and I think I am closer now, so I was hoping the following would jog someone's memory or tinfoil :)
Anyway, the paradox is that the following code runs instantly INSIDE of R :
library(RODBC)
myconn <- odbcConnect("****", uid = "*******", pwd = "*******")
test <- sqlQuery(myconn, "select * from tableAXd")
close(myconn)
summary(test)
But the very same code (in bat_test.R), sourced from a .bat file with this code:
C:\Users\********\Documents\R\R-3.3.1\bin\Rscript.exe "C:\schedule\bat_test.R"
generates the following error in the cmd window:
[RODBC] ERROR: state IM104, code 0, message [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and the Application...
So, why would the exact same code run sweetly from R, but choke on ODBC from a .bat file?
Thanks for listening... isotope