Skip to content

Instantly share code, notes, and snippets.

@dainiuxt
Last active November 20, 2019 14:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dainiuxt/23ce714e0deedc8da9a0 to your computer and use it in GitHub Desktop.
Save dainiuxt/23ce714e0deedc8da9a0 to your computer and use it in GitHub Desktop.
Connect MS Access database to R (RStudio) in Windows
library("RODBC") #load package
db<-file.path("C:/path/to/your/database.accdb") #connect database.
#Note the UNIX style slash (/). "\" is "escape character" so all "\"you should replace either with "/" or "\\"
channel<-odbcConnectAccess2007(db) #internal RODBC function
dataSetName<-sqlFetch(channel,"TableName") #read particular table from Access database file.
@dainiuxt
Copy link
Author

To use this connectivity under Win x64 you should use 32 bit version of R, because RODBC isn't working with 64 bits.
Also I'm still unsuccessful to connect MS Access database in above mentioned way (in any way if to tell you the truth) in linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment