【发布时间】:2015-09-21 21:52:20
【问题描述】:
我正在尝试从 R 连接到在 Microsoft Azure 中的虚拟机上运行的 Microsoft SQL Server 数据库。
这是我的连接字符串
library(RODBC)
channel = odbcConnect(dsn="something.cloudapp.net",uid="myusername",pwd="mypassword");
但是,我不断收到此错误
Warning messages:
1: In odbcDriverConnect("DSN=servername.cloudapp.net,1433;UID=myusername;PWD=mypassword") :
[RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
2: In odbcDriverConnect("DSN=servername.cloudapp.net,1433;UID=myusername;PWD=mypassword"):
ODBC connection failed
为什么我总是收到这个错误?
【问题讨论】:
-
你有没有created a dsn 作为 RODBC,据我使用它,需要定义的 dsn 才能登录。我将它创建为我所做的系统 dsn,它对我有用。您确实需要管理员才能执行此任务。
标签: sql-server r azure rodbc