[R] RODBC Access

Michal Kneifl xkneifl at mendelu.cz
Fri Jul 13 11:58:08 CEST 2007


Please could you write an example of this command: 
table.db<-sqlQuery(channel,paste("select * from table"))
With real names of .mdb file and table?
Thanks

Michael
----- Original Message ----- 
From: "Patrick Gonin" <pgoninstat1 at yahoo.com>
To: "Prof Brian Ripley" <ripley at stats.ox.ac.uk>
Cc: <r-help at stat.math.ethz.ch>
Sent: Friday, July 13, 2007 10:32 AM
Subject: Re: [R] RODBC Access


> Thank you Pr Ripley, it worked well with a simple sqlQuery rather than a 
> sqlFetch command:
> I paste it here in case some other users encounter a similar problem:
> table.db<-sqlQuery(channel,paste("select * from table"))
>
> Dr Patrick Gonin
> Institut Gustave Roussy
> 94800 Villejuif
> France
>
> Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: This is an ODBC issue, 
> not an R issue.  Use a command-line ODBC client to
> find a suitable SQL invocation to retrieve the data, and run that via
> sqlQuery.
>
> (It might be a quoting issue: Access is not using standard SQL.)
>
>
> On Thu, 12 Jul 2007, Patrick Gonin wrote:
>
>> Dear R users,
>>
>> I am trying to connect an Access database.
>> The code I use is :
>> channel<-odbcConnectAccess("Base")
>> table.db<-sqlFetch(Base,"table",colnames=T)
>>
>> When I look at the table in R, the table imported lacks the first 41
>> lines, and the column names are the values of the 42nd record.
>>
>> Any hints ?
>>
>> I am working on a WinXP pro 5.1 box, R 2.5-0 compiled from source using 
>> MINGW and R tools.
>> I searched R archives through Jonathan Baron site...
>>
>> Thank you very much for your help
>>
>> Dr P. Gonin
>> Institut Gustave Roussy
>> 94805 Villejuif
>> France
>>
>>
>> ---------------------------------
>>
>>  [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> 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.
>>
>
> -- 
> 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
>
>
>
> ---------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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