Josh -
There are two ways that I know of to use Access in R on
Windows:
1) odbcConnectAccess or odbcConnectAccess2007 in the ODBC package
and
2) Configuring the Access ODBC connector in
Control Panel -> Administrative Tools -> Data Sources(ODBC)
and using connectODBC in the ODBC package.
To configure the Access ODBC connector in the Data Sources task,
click "Add", scroll down and click on "Microsoft Access Driver (*.mdb)"
Give it a Data Source Name (with no spaces), an optional Description,
then click on "Select" for the database choice, and navigate to your
database. You should then be able to pass the Data Source Name you chose
to the odbcConnect function, and use the result in the odbcQuery to make
SQL queries to your data base.
Hope this helps.
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
[email protected]
On Tue, 22 Mar 2011, ROLL Josh F wrote:
I am getting into some more posts about having to have mdb-tools installed on
my system (Windows XP) and have located the download but its not an executable
install file and it looks like from what you said these tools are for
non-windows based systems anyhow?
Is the mdb.get function the only tool to read in mdb's from MS Access? I feel
like it should be easier than this? Thoughts?
Thanks Phil
JR
-----Original Message-----
From: Phil Spector [mailto:[email protected]]
Sent: Tuesday, March 22, 2011 1:01 PM
To: ROLL Josh F
Cc: [email protected]
Subject: Re: [R] Loading mdb
I believe that you are misinterpreting the error message.
The mdb-get function relies on external programs named "mdb-tables" and
"mdb-schema" to do its work. Those programs must be installed on your computer (and in
directories in your search path), for the function to work.
I don't know what operating system you are using, but the mdb tools are
designed for non-Windows systems.
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
[email protected]
On Tue, 22 Mar 2011, LCOG1 wrote:
Well im thoroughly frustrated after 25 minutes of checking and
rechecking my path. What do i not know about loading a mdb that is
keeping me from loading my data.
i have loaded the Hmisc library and pointed it too my data using
mdb.get and continue to get the following error.
Error in system(paste("mdb-tables -1", file), intern = TRUE) :
'mdb-tables' not found
Which i realize is saying that its not reading any tables within the
mdb or not able to find any mdb at all at that location.
the command i use is simply:
RawInv.data..<-mdb.get('T:/Models/LandUse/GenericLandSupplyModel/Proje
cts/2008BaseYear/EugeneUGB/Reporting/Summary.mdb')
There is definitely a mdb in that location and the path is definitely
correct. Its an MS Access mdb with 4 tables. When i open the said
mdb i have to hit enter at a password window but no password is
required. Could this be hanging up R from reading it? I have
typically used dbf and csv or txt for import formats and am not real
familiar with mdb but i realize how elementary this question is but i
have spent 25 minutes now. What am i missing.
Thanks
JR
--
View this message in context:
http://r.789695.n4.nabble.com/Loading-mdb-tp3397075p3397075.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.