找回密码
 立即注册
查看: 3750|回复: 4

为何不能使用ODBC读取excel文件?

[复制链接]
发表于 2014-10-21 23:58:42 | 显示全部楼层 |阅读模式
本帖最后由 大胡子猫 于 2014-10-22 00:22 编辑

Dears~
现在加载了包RODBC,
library(RODBC)
然后尝试读取Excel文件:
channel<-odbcConnectExcel2007("d:/RLearning/RData/Salary.xlsx")

此时开始报错:
Warning messages:1: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) :  [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序2: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) :  ODBC connection failed
请问可能是因为什么原因呢?

win7 64位系统的路过....



PS,情况不太乐观,help了一下
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-bitR: 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.



回复

使用道具 举报

发表于 2014-10-23 17:01:11 | 显示全部楼层
http://cos.name/videos/ 这里有讲ODBC 的 你可以看
回复

使用道具 举报

发表于 2014-10-26 19:54:21 | 显示全部楼层
估计你没有安装ODBC
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|R语言中文网

GMT+8, 2024-11-25 14:52 , Processed in 0.045934 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表