0

I have been using R for the last year for but it is the first time I need to import data through a SQL server. My data source is there, but for some reason R Studio fails to establish a connection and gives me following error: [RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data source name not found, and no default driver specified

I have searched a lot online but all advice given refers to creating a dsn, but in my case the data source name has already been created. I am accessing R Studio on a web browser through R Studio Server.

Thanks in advance

  • 1
    You say your data source is there but the computer says not. Trust your computer. Check you are using the right name when requesting the data source, keyed correctly. How do you know the data source is correct? Have you accessed it through a different method to prove? – Sarah Phillips Sep 25 '17 at 13:20
  • Possible duplicate of [Failure to connect to odbc database in R](https://stackoverflow.com/questions/17069231/failure-to-connect-to-odbc-database-in-r) – Eumenedies Sep 25 '17 at 13:29
  • I go into my ODBC data source administrator, and under user data sources I see the name MetrixIDR43, and this is what I use in my R code but still get the same error. That's my code: dbhandle <- odbcDriverConnect("Server= WSQLD003P01;Database=MetrixIDR43;Uid=myuserid;Pwd=password;") – Vassi27 Sep 25 '17 at 15:22
  • Yes Sarah, I access the data source through SQL Server Management Studio. odbcDriverConnect("Driver={SQL Server Native Client 10.0};Server=WSQLD003P01\\SQL01;Database=MetrixIDR43;Trusted_Connection=Yes") – Vassi27 Sep 25 '17 at 16:04

1 Answers1

0

At the end it turns out that the issue was due to the company R Server being high trust, and the server I was trying to connect to is default trust. So the company's IS team is working on enabling SQL to pass through high/default trust servers.