0

I am trying to read MS Access db file .mdb into R

library(RODBC)

db <- odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};
                        DBQ=Input/some_db.mdb")

Here is my error:

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

I am not sure how to start troubleshooting.

10
  • 2
    What does odbcListDrivers() return? Commented Jul 31, 2020 at 22:14
  • 3
    Not sure if it's related, but ... if the bit-ness of R does not agree with the bit-ness of the ODBC driver and of Office as installed on the system, I've had (debilitating) problems. (E.g., R-4.0.2-64bit won't be able to use Access ODBC drivers if you have Office 32-bit installed.) A quick test is to run the other bit-ness of R. Commented Jul 31, 2020 at 22:16
  • 2
    You shouldn't need both odbc and RODBC to do basic operations, for the record. Does odbcDataSources() include anything? (I'm not an RODBC user, so I'm just guessing.) Commented Jul 31, 2020 at 22:17
  • 2
    Try the older 32-bit version: Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\Full Path\\To\\myDatabase.mdb Commented Jul 31, 2020 at 23:59
  • 1
    What did odbcDataSources() show? Note: this is different than function you tried above (from different package). This shows all available ODBC drivers on machine. See if MS Access drivers show. Commented Aug 1, 2020 at 3:57

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.