dbListTables(con) which gives a list of 999 tables (and 51 more beyond the print limit). That is after issuing:
con <- dbConnect(odbc::odbc(), "MSSQL2", UID = "sa", PWD = "pwd",database="dbname")
If instead I use:
odbcConnect("MSSQL2",uid="sa",pwd="pwd") I get:
[1] -1
Warning messages:
1: In RODBC::odbcDriverConnect("DSN=MSSQL2;UID=sa;PWD=pwd") : [RODBC] ERROR: state ��, code 20013, message
2: In RODBC::odbcDriverConnect("DSN=MSSQL2;UID=sa;PWD=pwd") : [RODBC] ERROR: state ��, code 0, message
3: In RODBC::odbcDriverConnect("DSN=MSSQL2;UID=sa;PWD=pwd") :
ODBC connection failed
And this:
library(RODBC)
SEIS <- odbcConnect('driver={SQL Server};server=tcp:192.168.3.10,1433;database=dbname;trusted_connection=true')
There were 50 or more warnings (use warnings() to see the first 50)
warnings()
Warning messages:
1: In RODBC::odbcDriverConnect("DSN=driver={SQL Server};server=tcp:192.168.3.10,1433;database=SEIS;trusted_connection=true") :
[RODBC] ERROR: state IM002, code 26252160, message [iODBC][Driver Manager]Data source name not found and no default driver specified. Driver could not be loaded
Only the first attempted connection seems to returns without error but the tables it shows are not from my db.
MSSQL2 is the DSN that I use from other programs and it works fine.