[R] Fwd: Problem with ODBC connection

Daniel Nordlund djnordlund at frontier.com
Tue Jun 11 07:32:59 CEST 2013


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
> On Behalf Of Jeff Newmiller
> Sent: Monday, June 10, 2013 9:45 PM
> To: Christofer Bogaso; r-help
> Subject: Re: [R] Fwd: Problem with ODBC connection
> 
> Given the resounding silence, I would venture to guess that no-one here is
> interested in troubleshooting ODBC connections to Excel. The problem is
> most likely in the ODBC driver for Excel (not in R or RODBC), and Excel is
> NOT a database (so any data format problem is unlikely to be detected).
> --------------------------------------------------------------------------
> -
> Jeff Newmiller                        The     .....       .....  Go
> Live...
> DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live
> Go...
>                                       Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.
> rocks...1k
> --------------------------------------------------------------------------
> -
> Sent from my phone. Please excuse my brevity.
> 
> Christofer Bogaso <bogaso.christofer at gmail.com> wrote:
> 

I tried reading your workbook using your code, i.e.

library(RODBC)
MyData <- sqlFetch(odbcConnectExcel('mypath/Myfile.xls'), "aaaa")
head(MyData, 30)

and got an error message saying that odbcConnectExcel is only usable with 32-bit Windows and I have a 64-bit system, so I can't help you there.  But there are many other options in R for reading Excel workbooks.  I was able to read your data using the read.xls function from the gdata package.  I am not endorsing that package, it just happened to be the first package on my system that I tried.  

So if you can't read the data one way, try another.  You could install and load the sos package and runthe following function

findFn('xls')

and you will get all sorts of suggestions.


Hope this is helpful,

Dan

Daniel Nordlund
Bothell, WA USA



More information about the R-help mailing list