Failure to connect to odbc database in R

匿名 (未验证) 提交于 2019-12-03 01:09:02

问题:

I've been trying to connect my company's DMS to R using the odbcConnect command, but get the following message:

myConn 

The thing is, I'm positive the Data source name is NZSQL and my uid and password are correct as well. Any insight as to why R may not be finding my data source / driver (the driver is, by the way, specified and working).

Thanks!

回答1:

I ran across this same problem when I was first trying to connect to an Oracle database. In the end what worked for me was using odbcDriverConnect and a connection string instead of odbcConnect.

myConn 

You can check on https://www.connectionstrings.com/ for your specific connection string for your database. Mine happened to be this one.

Hope this helps.



回答2:

I was trying to access SQL Server database and got the same error. After using the correct format of db connection, I got access to my sql server database.

dbhandle 


回答3:

What worked for me was a 32 bit connection instead of a 64 bit connection.



回答4:

I know this is old but also make sure that you remove the spaces around the '=' sign. That was my problem.



回答5:

This is IM02 error which means name of the DSN is incorrect.

GO to ODBC and check the USER/System DSN that you should be using. Once your name of DSN is correct, you might get IM014 state error which is archtecture mismatch. In that case,

The simpler solution is IN r studio - go to tools and change the version of R to 32 bit.

It should be ready to work



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!