[R] Creating an Access (.mdb) database using R

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jun 7 11:51:54 CEST 2007


On Wed, 6 Jun 2007, Moshe Olshansky wrote:

> Hello!
>
> I have a short question:  Is it possible to create a
> (non-existing) Access database using R (and if yes,
> how)?  I need to create a new database and then insert
> a few tables into it.

Short answer: yes, if you are using Windows (you did not say).

Slightly longer answer 1:

If you have the ODBC drivers installed,

> library(RODBC)
> ch <- odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb)}")

will allow you to create a database and select it.

Slightly longer answer 2:

Use DCOM to control Access if you have that installed.  I'll leave you to 
do your own homework on this one.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list