I followed this guide http://eriqande.github.io/2014/12/19/setting-up-rodbc.html to get RODBC working with MAC and I am able to connect to the DB.
Marcos-MacBook-Pro:~ MarcoB$ isql -v ODBC_SQLSS_R **** ******
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
The configuration files are set according to the guide.
Marcos-MacBook-Pro:~ MarcoB$ cat /usr/local/etc/freetds.conf
[ODBC_SQLSS_R]
host = xxx.xxx.xxx.xxx
port = 1433
client charset = UTF-8
Marcos-MacBook-Pro:~ MarcoB$ cat /usr/local/etc/odbc.ini
[ODBC_SQLSS_R]
Driver = /usr/local/lib/libtdsodbc.so
Server = xxx.xxx.xxx.xxx
POrt = 1433
I install the RODBC package
> install.packages("RODBC", type = "source")
...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RODBC)
And when I try it out it seems that it does not use my UnixODBC libraries.
library("RODBC")
odbcDataSources()
named character(0)
When I try to connect via ODBC
odbcConnect("ODBC_SQLSS_R", uid=“*****", pwd=“******");
Warning messages:
1: In odbcDriverConnect("DSN=ODBC_SQLSS_R;UID=*****;PWD=*****") :
[RODBC] ERROR: state IM002, code 1962223636, message [iODBC][Driver
Manager]Data source name not found and no default driver specified.
Driver could not be loaded
The error message indicates to me that RODBC is still using iODBC. I browsed the internet for days now but I can't find a solution for the problem. Would be really amazing if anybody here could point me in the right direction.
Marco
odbcinst.ini
file look like? I think you need something to the effect of[ODBC Drivers] \ freetds=installed \ [freetds] \ driver = /usr/local/lib/libtdsodbc.so \ setup = /usr/local/lib/libtdsodbc.so
(where the `\` should actually be line breaks). – Vacla