brew updatebrew install unixodbcbrew install freetdsIt looks like there is no need to specify --with-unixodbc any more.
I would add only that I had to edit not
/etc/odbcinst.ini
but
/usr/local/etc/odbcinst.ini,
On Linux it looks like this[FreeTDS]Description = TDS driver (Sybase/MS SQL)Driver = /usr/lib/odbc/libtdsodbc.soSetup = /usr/lib/odbc/libtdsS.soThreading = 1
CPTimeout =
CPReuse =
FileUsage = 1
On Mac paths are a bit different[FreeTDS]Description = TDS driver (Sybase/MS SQL)Driver = /usr/local/lib/libtdsodbc.soSetup = /usr/local/lib/libtdsS.soThreading = 1
CPTimeout =
CPReuse =
FileUsage = 1
then it worked just fine.Here is a sample code:
library(RODBC)
# replace server.name, database.name, user.id, password and T_my_table correspondingly
con <- odbcDriverConnect("DRIVER={FreeTDS};SERVER=server.name;DATABASE=database.name;UID=user.id;PWD=password;")
strSql <- "select * from T_my_table"
x <- sqlQuery(con, strSql)
close(con)
cat(x)