0

I am looking to connect to the SQL server using RStudio Server. Initially I used the library(RJDBC) to connect to SQL server by creating a new username and password and connect using the code below

drv <- JDBC("com.microsoft.sqlserver.jdbc.SQLServerDriver","/home/user/sqljdbc4-4.0.jar")
conn <- dbConnect(drv, "jdbc:sqlserver://servername;username=username;password=password")

However recently due to compliance I have to use my windows user id and password in order to connect. I tried using the RODBC with trusted connection but it still does not work. I am wondering if it is because I am using the R server as compared to R desktop and hence it cannot recognize my trusted connection. If that is the case then what is the workaround?

I have tried links below but nothing worked

Connect R to a SQL Server database engine

RODBC odbcDriverConnect() Connection Error

Following is the error that I am getting

[RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found

What would this error mean?

Molia
  • 311
  • 2
  • 17
  • *windows user id*? Yet, your paths and error suggest unix machine like Linux/Mac. – Parfait Jul 12 '19 at 20:43
  • What port are you using? Have you checked to ensure that the database allows traffic on that port? – Rich Pauloo Jul 12 '19 at 21:45
  • @Parfait I am using my windows id to get into R server on Unix and trying to use the R server to get into SQL server using the windows id that i initially used to get into R server. Does that make sense? – Molia Jul 13 '19 at 00:07

0 Answers0