I use the following specs to connect to db from Matlab and it works:
% Matlab code
spec.dbName = 'xxxyyy';
spec.login = 'uid';
spec.pwd = 'mypwd';
spec.driver = 'net.sourceforge.jtds.jdbc.Driver';
spec.url = 'jdbc:jtds:sqlserver://vmsqlprod7:1234/xxxyyy';
conn = database(spec.dbName, spec.login, spec.pwd, spec.driver, spec.url);
I'm almost sure this is all I need to connect from R. But I can't seem to make it work with the following code:
## R code
require(RODBC)
con <- odbcDriverConnect(connection=
"driver=net.sourceforge.jtds.jdbc.Driver;
server=jdbc:jtds:sqlserver://vmsqlprod7:1234/xxxyyy;
database=xxxyyy;
uid=uid;
pwd=mypwd")
It throws out this error:
[ODBC Driver Manager] Data source name not found and no default driver specified
I've read this and I suspect it's about the format of the url or driver string, but I don't know exactly how to make it recognizable by R.
I can really use some help here!
Environment: Windows 7, 64 bit.
R version: 3.3.3