[R] RODBC connect to Excel (64-bit Windows 7)

andrija djurovic
2011-12-04T14:40:21Z

Hi to all.
 I have a problem to connect to an Excel database using RODBC.
Namely, I am using 64-bit R 2.14.0, under Windows 7 and I tried following:
library(RODBC)
> channel <- odbcConnectExcel("results.xlsx")
Error in odbcConnectExcel("results.xlsx") :
  odbcConnectExcel is only usable with 32-bit Windows       # ok this is
clear why it doesn't work
> channel <- odbcConnectExcel2007("results.xlsx")             #
this was
one of proposals from old R help posts, but it doesn't work for me
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

After that as it suggested in R data import/export manual I
installed AccessDatabaseEngine.exe. Also I used ODBC in
c:\Windows\SysWOW64\odbcad32 to create data source called result. I check
if it is created:
> odbcDataSources()
                                             dBASE Files
   "Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)"
                                      MS Access Database
              "Microsoft Access Driver (*.mdb, *.accdb)"
                                              Excel file
"Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)"
                                                * results*
"Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)"

and tried again but it doesn't work:

> channel <- odbcDriverConnect()
Warning messages:
1: In odbcDriverConnect() :
  [RODBC] ERROR: state IM014, code 0, message [Microsoft][ODBC Driver
Manager] The specified DSN contains an architecture mismatch between the
Driver and Application
2: In odbcDriverConnect() : ODBC connection failed


Could someone guide me what should I try next to fix a problem? Is this
some problem with Drivers or not?

Thanks in advance

Andrija

	[[alternative HTML version deleted]]