我正在尝试将 R 与 Windows 7 64 位机器上的 MS Access 数据库连接起来。
library(RODBC)
con <- odbcConnectAccess2007("M:/path/to/mydatabase/my.database.accdb")
# [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specifiedODBC connection failed
我也尝试过使用https://www.connectionstrings.com/access/odbc
指定的连接字符串打包,但同样无法连接
library(DBI)
con <- dbConnect(drv = odbc::odbc(), dsn = "Microsoft Access Driver", driver = "Microsoft Access Driver (*.mdb, *.accdb)", database = "M:/path/to/mydatabase/my.database.accdb")
# Error: nanodbc/nanodbc.cpp:950: IM002: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
我究竟做错了什么?