[R] Import data from Access
Greg Snow
Greg.Snow at intermountainmail.org
Thu May 31 18:59:34 CEST 2007
You need to do 1 of 2 things (but not both).
Either register your database file with your odbc driver (done outside
of R)
Or
Use odbcConnectAccess in place of odbcConnect
The 2nd is simpler if you just want to import that file, the first may
be better in the long run if you are going to be working with the
database quite a bit.
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of livia
> Sent: Thursday, May 31, 2007 9:55 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Import data from Access
>
>
> Hi, I want to import some data from Access and I am using the
> following
> codes:
>
> testdb <- file.path("c/../db1")
> channel <- odbcConnect("testdb")
> sqlFetch(channel,"tbl",colnames = TRUE, rownames = FALSE)
>
> It comes out the error message:
>
> 1: [RODBC] ERROR: state IM002, code 0, message
> [Microsoft][ODBC Driver Manager] Data source name not found
> and no default driver specified
> 2: ODBC connection failed in: odbcDriverConnect(st, ...)
>
> Anyone can help me sort it out? Many thanks.
>
> --
> View this message in context:
> http://www.nabble.com/Import--data-from-Access-tf3847342.html#
> a10896743
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
More information about the R-help
mailing list