When I tried to connect R with Access database I get an error
odbcConnectAccess is only usable with 32-bit Windows
Does anyone has an idea how to solve this?
library(RODBC)
mdbConnect<-odbcConnectAccess("D:/SampleDB1/sampleDB1.mdb")
When I tried to connect R with Access database I get an error
odbcConnectAccess is only usable with 32-bit Windows
Does anyone has an idea how to solve this?
library(RODBC)
mdbConnect<-odbcConnectAccess("D:/SampleDB1/sampleDB1.mdb")
I came across this SO when encountering a similar problem and at this point we have at least one more option with the extremely flexible odbc library.
An important note here though: the MS Access ODBC driver is not part of a default MS Office installation so you will have to download the appropriate driver from Microsoft (Microsoft Access Database Engine 2016 Redistributable in my case) and be sure to download the appropriate bitness (e.g. AccessDatabaseEngine_X64.exe). Once that has been downloaded it should automatically show up in your Windows ODBC Data Sources (64-bit) utility or you can confirm inside an R session with the odbcListDrivers function.
Did not succeed with the given answers, but here is the step by step approach that eventually did the trick for me. Have Windows 8 on 64 bit. With 64 and 32 bit R installed. My Access is 32 bit.
Steps to use, assuming 32 bit Access on windows 8
Now I could run the code that I liked
Using advice from others, here's an explicit example of getting 32-bit Access data into 64-bit R that you can write into a script so that you don't need to do the steps manually. You do need to have 32-bit R available on your machine for this to run, and this script assumes a default location for the 32 bit R, so adjust as needed.
The first code part goes into your main script, the second code part is the entire contents of a little R script file that you create and is called from the main script, this combination extracts and saves and then loads the data from the access database without having to stop.
Here's the bit that goes in my main script, this is run from within 64 bit R
Here's the bit that is the separate script called GetAccessTables.R
Use
odbcDriverConnect
instead. If you have 64-bit R installed, you may have to use the 32-bit R build.Here is a single function that will transfer data from 32 bit access to 64 bit R without having to save any files. The function builds an expression string that is passed to a second 32 bit session; data is then returned to the original session using socket server package (svSocket). One thing to note is that the socket server saves the access data in the global environment so the second parameter is used to define the output instead of using "<-" to save the output.
Occasionally this function will return an error, but it does not impact data retrieval and appears to result from closing the socket server connection.
There is likely room for improvement, but this provides a simple and quick method to pull data into R from 32 bit access.
The following solution worked for me: found on reading-data-from-32-bit-access-db-using-64-bit-R It says to install the 64-bit database engine from: microsoft`
Then: find and run "ODBC-datasources (64-bits)".
Then in R: