Reputation: 109
I have been working for several hours at getting RODBC connected to SQL Server 2012 on OSX Yosemite using RODBC and unixodbc. The error I receive in R is quite generic:
> odbcDriverConnect("DSN=ISTSQL;UID=sa;PWD=***")
[1] -1
Warning messages:
1: In odbcDriverConnect("DSN=ISTSQL;UID=sa;PWD=***") : [RODBC] ERROR: state ±6S, code 20013, message
2: In odbcDriverConnect("DSN=ISTSQL;UID=sa;PWD=***") : [RODBC] ERROR: state ±6S, code 0, message
3: In odbcDriverConnect("DSN=ISTSQL;UID=sa;PWD=***") :
ODBC connection failed
Warning messages:
1: In strsplit(msgs[i], "\n") : input string 1 is invalid in this locale
2: In strsplit(msgs[i], "\n") : input string 1 is invalid in this locale
My /etc/freetds.conf
file includes the following:
[ISTSQL]
host = ip.address
port = 1433
tds version = 8.0
My /etc/odbcinst.ini
file is as follows:
[MSSQL]
Description = Microsoft SQL Server driver
Driver = /usr/local/Cellar/freetds/0.95.8/lib/libtdsodbc.so
UsageCount = 1
And my /etc/odbc.ini
file is as follows:
[ISTSQL]
Driver = MSSQL
Servername = ISTSQL
Port = 1433
Database = TMS
TDS_Version = 8.0
I can connect to the database from the command line via the tsql
command and the isql
command. Does anyone have any idea how I might troubleshoot this issue or find more detailed error logs?
Upvotes: 1
Views: 445
Reputation: 9687
For better error messages, note this in ?warning
:
Warnings will be truncated to 'getOption("warning.length")'
characters, default 1000, indicated by '[... truncated]'.
That might help you get better info for debugging.
Upvotes: 2