RODBC with MAC not working. Using unixODBC and Rstudio

2.1k views Asked by At

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

1

There are 1 answers

3
Marco Blume On

A clean reinstall of my Mac seem to have solved the library issues. I just followed the guide exactly again and it worked.