rmacosrstudiofilemakerrodbc

Connect R to Filemaker Pro 15 on Mac


I'm trying to create a connection between R (3.3.3) Using RStudio (1.0.143) and Filemaker Pro Advanced 15 (15.0.3.305). I'm trying to create the connection using RODBC (1.3-15).

So far I:

Created a toy FM Pro database for testing

Followed these instructions for creating a DSN

Created a DSN for my toy FM Pro database called test_r

enter image description here

Successfully tested the connection to test_r

enter image description here

Unsuccessfully attempted to connect to the DSN in RStudio in the following two ways:

fm_connection <- odbcConnect(dsn="test_r", uid="Admin", pwd="password")

Which returns the following error:

[RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data source name not found, and no default driver specifiedODBC connection failed

AND

constr <- paste("driver={FileMaker ODBC}",
               "server=127.0.0.1",
               "database=test_r",
               "uid=Admin",
               "pwd=password",
               sep=";")

fm_connection <- odbcDriverConnect(constr)

Which returns the following error:

[RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib 'FileMaker ODBC' : file not foundODBC connection failed

However, you can see that the driver is there:enter image description here

Finally, I've unsuccessfully tried using these (and other) references to resolve this issue:

  1. https://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf
  2. https://community.filemaker.com/thread/165849

Nothing seems to work so far. I'm not tied to RODBC, but I do need a solution that works for Mac OS. Any help is appreciated!


Solution

  • I got this to work using odbc instead of RODBC some new R code:

    con <- DBI::dbConnect(odbc::odbc(),
                          driver = "/Library/ODBC/FileMaker ODBC.bundle/Contents/MacOS/FileMaker ODBC",
                          server = "127.0.0.1",
                          database = "/Users/bradcannell/Dropbox/Filemaker Pro/Notes/test_r.fmp12",
                          uid = "Admin",
                          pwd = "password")