Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to MS Access Database from R (x64)

I am trying to access my Access database using R. I have tried the below options but I am not able to connect to the database. I am using 64 bit R and 64 bit Access. I am using windows 7 also.. :(

library(RODBC)
db <- "E:/testdb.accdb"
myconn <-odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=E:/test.accdb")
con2 <- odbcConnect(db)
channel <- odbcConnectAccess("E:/testdb")

I always get the error. Please help me.

1: In odbcDriverConnect("DSN=E:/testdb.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("DSN=E:/testdb.accdb") : ODBC connection failed
like image 711
Arun Raja Avatar asked Jun 19 '15 07:06

Arun Raja


1 Answers

I think the problem is as error message suggests - you don't have x64 Microsoft Access driver installed. Check it in Control panel - ODBC Data Sources (x64) on the Drivers tab. If it's not there, try to install Microsoft Access Database Engine 2010 Redistributable.

like image 123
cyberj0g Avatar answered Sep 21 '22 09:09

cyberj0g