Skip to content
Prev 58330 / 398502 Next

ms access --> mysql --> R in Linux

Anne York <york at zipcon.net> writes:
I have used it several times. The ODBC driver is not really (at all?)
working but the command line tools seem to work well enough.  I
modified mdb-export and created a script that worked like mysqldump
(to produce CREATE TABLE and INSERT statements) so that I was able to
get the tables into MySQL to use with R.  The latest version is quite
a bit more recent than the one I have been using and I believe it has
more features. 

Here is something that I have just tried and seems to work and avoids
the need to take your data into another database:

x <- read.table(pipe('mdb-export -d "\t" databasename.mdb tableName'), sep="\t", header=TRUE)

mdb-export exports the contents of a table from an Access database
(fields separated with commas by default). The -d option specifies the
delimiter (I prefer to use a tab).  This seems to work well on my
relatively small test database. I guess it would not take much work to
write a little set of functions to get the table names (using
mdb-tables) and do some other useful things. Not as good as having a
working ODBC driver, but quite nice all the same.

I'll have spend a little more time playing with this...

Dave