I have probably an old question. I have R.3.0.1 installed in 64 bit windows 7. The odbcConnectExcel in RODBC library does not work. Tried odbcConnectExcel2007 still does not work. Any ideas. Thanks Melissa<-sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"),sqtable = "Sheet3", + na.strings = "NA", as.is = TRUE) Error in sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"), : first argument is not an open RODBC channel In addition: Warning messages: 1: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 2: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : ODBC connection failed>Melissa<-sqlFetch(odbcConnectExcel("F:\\Cotton2012\\validation.xlsx"),sqtable = "Sheet3", + na.strings = "NA", as.is = TRUE) Error in odbcConnectExcel("F:\\Cotton2012\\validation.xlsx") : odbcConnectExcel is only usable with 32-bit Windows -- Ahmed M. Attia Research Assistant Dept. Of Soil&Crop Sciences Texas A&M University ahmed <ahmedatia@zu.edu.eg>.attia@ag.tamu.edu Cell phone: 001-979-248-5215 [[alternative HTML version deleted]]
Can't help you with the odbcConnectExcel, but I can suggest an alternative ... loadWorkbook() and readWorksheet() in the XLConnect package work on Windows 7 64-bit. library(XLConnect) wb <- loadWorkbook("C:/Temp/Mydata.xlsx") dat <- readWorksheet(wb, sheet="Sheet1") Jean On Tue, Jul 16, 2013 at 1:25 PM, Ahmed Attia <ahmedatia80@gmail.com> wrote:> I have probably an old question. > > I have R.3.0.1 installed in 64 bit windows 7. The odbcConnectExcel in RODBC > library does not work. Tried odbcConnectExcel2007 still does not work. > > > Any ideas. > > Thanks > > > Melissa<-sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"),sqtable > = "Sheet3", > + na.strings = "NA", as.is = TRUE) > Error in sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"), > : > first argument is not an open RODBC channel > In addition: Warning messages: > 1: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : > [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver > Manager] Data source name not found and no default driver specified > 2: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : > ODBC connection failed > > > > Melissa<-sqlFetch(odbcConnectExcel("F:\\Cotton2012\\validation.xlsx"),sqtable > = "Sheet3", > + na.strings = "NA", as.is = TRUE) > Error in odbcConnectExcel("F:\\Cotton2012\\validation.xlsx") : > odbcConnectExcel is only usable with 32-bit Windows > > -- > Ahmed M. Attia > > > Research Assistant > Dept. Of Soil&Crop Sciences > Texas A&M University > ahmed <ahmedatia@zu.edu.eg>.attia@ag.tamu.edu > Cell phone: 001-979-248-5215 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org 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. >[[alternative HTML version deleted]]
Tena koe Perhaps the help file will give you some ideas: "odbcConnectAccess, odbcConnectDbase and odbcConnectExcel are convenience wrappers to generate connection strings for those file types. The files given can be relative to the R working directory or absolute paths (and it seems also relative to the user's home directory). The file name can be omitted, which will on Rgui bring up a dialog box to search for a file. Note: they will only work with English-language 32-bit versions of the Microsoft drivers, which may or may not be installed in other locales, and are not usable from 64-bit R. The 2007 versions work with the drivers which are installed with Office 2007/2010 and give access to formats such as '*.xlsx' and '*.accdb'. These drivers are also available separately and there is a 64-bit version: see the package manual. (You must have the 32-bit drivers when using 32-bit R and the 64-bit drivers when using 64-bit R: otherwise there will be a cryptic message about a driver not being found. And the 64-bit drivers cannot be installed alongside 32-bit Microsoft Office, and vice versa. See the package manual for some of the peculiarities of the Excel drivers. readOnly = TRUE may allow very limited changes (to insert and update rows)." HTH .... Peter Alspach -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Ahmed Attia Sent: Wednesday, 17 July 2013 6:25 a.m. To: r-help at r-project.org Subject: [R] Importing data by odbcConnectExcel in 64 bit I have probably an old question. I have R.3.0.1 installed in 64 bit windows 7. The odbcConnectExcel in RODBC library does not work. Tried odbcConnectExcel2007 still does not work. Any ideas. Thanks Melissa<-sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"),sqtable = "Sheet3", + na.strings = "NA", as.is = TRUE) Error in sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"), : first argument is not an open RODBC channel In addition: Warning messages: 1: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 2: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : ODBC connection failed>Melissa<-sqlFetch(odbcConnectExcel("F:\\Cotton2012\\validation.xlsx"),sqtable = "Sheet3", + na.strings = "NA", as.is = TRUE) Error in odbcConnectExcel("F:\\Cotton2012\\validation.xlsx") : odbcConnectExcel is only usable with 32-bit Windows -- Ahmed M. Attia Research Assistant Dept. Of Soil&Crop Sciences Texas A&M University ahmed <ahmedatia at zu.edu.eg>.attia at ag.tamu.edu Cell phone: 001-979-248-5215 [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org 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. The contents of this e-mail are confidential and may be ...{{dropped:14}}