- Open MS Access, create a new database called
test.accdb
, - create or import a new table into the database, call it
TABLE1
, and save.
- Open R, install and load the RODBC R package,
- set your working directory to the place where the Access file is located (or adjust the path accordingly in the code below),
- run the following R code and see if what you have in Access and the data frame in R match.
library(RODBC)
setwd("your/path/comes/here")
con <- odbcConnectAccess2007("test.accdb")
tab <- sqlFetch(con, "TABLE1")
close(con)
str(tab)
That's all!