I cannot successfully connect MS Access to R. While reading other threads on stack overflow, I followed the suggestions of using 32-bit Access, changing Rstudio to 32-bit, and using the microsoft Access odbc Driver. I am not sure what to do further...
I used the following instructions:
- Open ODBC Data Sources (32-bit) from windows start menu
- Under System DSN tab, add driver Microsoft Access Driver (*.mdb, *.accdb), name driver MS Access Driver, click "OK"
- In Rstudio, under tools,select Global Options, change R version to:[Default] [32-bit] C:\Program Files\R\R-3.5.1
- In Rstudio, write the following script:
library(RODBC)
Data <- odbcDriverConnect("Driver={MS Access Driver}; DBQ=C:/Users/Owner/Desktop/Database1.accdb"
The warning message I receive reads:
Warning messages: 1: In odbcDriverConnect("Driver={MS Access Driver};DBQ=C:/Users/Owner/Desktop/Database1.accdb") : [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
2: In odbcDriverConnect("Driver={MS Access Driver2};DBQ=C:/Users/Owner/Desktop/Database1.accdb") : ODBC connection failed
Please, any help would be appreciated. I was not able to glean enough information solely from other R to Access connection threads.
odbc::odbcListDrivers()
, do you see something like"Microsoft Access Driver (*.mdb, *.accdb)"
? I think that's what should be used inside theDriver={...}
portion of your connection string, btw. – r2evans