[R-SIG-Mac] RODBC not connecting from my Mac
Marc Schwartz
marc_schwartz at me.com
Fri Oct 25 14:54:22 CEST 2013
On Oct 13, 2013, at 11:41 AM, Mikkel Grum <mi2kelgrum at yahoo.com> wrote:
> iODBC appears no longer to come standard with OSX, so I installed unixodbc and set it up following instructions here: http://www.boriel.com/en/2013/01/16/postgresql-odbc-connection-from-mac-os-x/
>
> I connected to my remote database with isql -v mydsn. No problem. Then I tried from R:
>
>> library(RODBC)
>> pg <- odbcConnect("mydsn") # waited for a couple of minutes before pressing Ctrl-C
> ^C
> There were 50 or more warnings (use warnings() to see the first 50)
>> warnings()[1:2]
> Warning messages:
> 1: In odbcDriverConnect("DSN=mydsn") :
> [RODBC] ERROR: state IM002, code 1606406032, message [iODBC][Driver Manager]Data source name not found and no default driver specified. Driver could not be loaded
> 2: In odbcDriverConnect("DSN=mydsn") :
> [RODBC] ERROR: state IM002, code 1606406032, message [iODBC][Driver Manager]Data source name not found and no default driver specified. Driver could not be loaded
>
> It looks like RODBC might only work with iODBC on the Mac. Is that the case? I haven't been able to configure iODBC correctly, and therefore haven't been able to test whether that would work with RODBC. Any chance that I can get RODBC to work with unixodbc? Any other information that would be useful in resolving it?
>
>> sessionInfo()
> R version 3.0.2 (2013-09-25)
> Platform: x86_64-apple-darwin10.8.0 (64-bit)
>
> locale:
> [1] C/UTF-8/C/C/C/C
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] RODBC_1.3-8
>
> Regards
> Mikkel
First, no need to cross-post to three groups. I am replying to R-SIG-Mac only here.
iODBC is still available on OSX. Apple removed the ODBC Administrator application back on Snow Leopard. A newer ODBC Manager application is freely available for download here:
http://www.odbcmanager.net/index.php
It is supported by Actual Technologies, which offers for purchase, ODBC drivers on OSX for various data sources. I use their driver for Oracle.
If you want to use the older Apple ODBC Administrator application, it is still available here:
http://support.apple.com/kb/DL895
If you want to stay with unixODBC, you may want to read through the vignette for RODBC that Prof. Ripley has written and pay attention to the Installation section on page 22:
http://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf
which has some hints that should be helpful, such as using:
--with-odbc-manager=odbc
when installing RODBC from source. Yes, RODBC will, by default, use iODBC on OSX, since that is the default ODBC installation on OSX. Thus, the precompiled binary for RODBC will not work for what you are attempting to do.
Regards,
Marc Schwartz
More information about the R-SIG-Mac
mailing list