简体   繁体   English

从R连接到并行VM上的SQL Server

[英]connect to SQL server on Parallel VM from R

I have my Rstudio installed on Mac, and SQL server Management studio in Parallel VM. 我在Mac上安装了Rstudio,并在Parallel VM中安装了SQL Server Management Studio。 now, I am trying to connect R with SQL server using RODBC package. 现在,我正在尝试使用RODBC软件包将R与SQL Server连接。 I think I have the sql server driver installed on my computer. 我想我的计算机上安装了sql服务器驱动程序。 i am not familiar with database. 我对数据库不熟悉。 below are what I did: 以下是我的工作:

  1. set up User DSN 'orca4' in Parallel VM (Windows 7), driver name 'SQl Server Native Client 11.0' (it was tested successfully). 在并行VM(Windows 7)中设置用户DSN'orca4',驱动程序名称为'SQl Server Native Client 11.0'(已成功测试)。

  2. run R odbcConnect('orca4'), it gave me message '[iODBC][Driver Manager]Data source name not found and no default driver specified. 运行R odbcConnect('orca4'),它给我消息'[iODBC] [Driver Manager]数据源名称未找到,并且未指定默认驱动程序。 Driver could not be loaded' 驱动程序无法加载'

  3. then I tried cn <- odbcDriverConnect(connection="Driver={SQL Server Native Client 11.0};server='1244gfgfgr';database='NewHome'; trusted_connection=yes;"). 然后我尝试了cn <-odbcDriverConnect(connection =“ Driver = {SQL Server Native Client 11.0}; server ='1244gfgfgr'; database ='NewHome'; Trusted_connection = yes;”)。 i got similar message ERROR: state IM003, code -1988948897, message [iODBC][Driver Manager]Specified driver could not be loaded 我收到类似的消息错误:状态IM003,代码-1988948897,消息[iODBC] [Driver Manager]指定的驱动程序无法加载

Could anyone let me know what is the problem here? 谁能告诉我这里是什么问题?

It's the client that needs the DSN, not the server. 需要DSN的是客户端,而不是服务器。 You want to create a DSN on your Mac that R can access. 您想要在Mac上创建R可以访问的DSN。 I'm not familiar with how to do this on OSX, but looks like this link might help: 我不熟悉如何在OSX上执行此操作,但是看起来此链接可能会有所帮助:

http://www.actualtech.com/readme.php http://www.actualtech.com/readme.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM