I am able to make connection from my laptop (window's) to the database using the below details
conn2 <- DBI::dbConnect(odbc::odbc(),
Driver = "ODBC Driver 17 for SQL Server",
Server = "XXXX" ,
Database = "XXXX",
Trusted_Connection = "yes")
but when I try to connect to rstudio pro which is using a linux/unix machine the same code give me error
conn2 <- DBI::dbConnect(odbc::odbc(),
Driver = "ODBC Driver 17 for SQL Server",
Server = "XXXX" ,
Database = "XXXX",
Trusted_Connection = "yes")
The error is
Error: nanodbc/nanodbc.cpp:983: 00000: [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]MAX_PROVS: Error Locating Server/Instance Specified [xFFFFFFFF]. [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
I used the same code and the details are correct as I am able to make connection via window's machine not sure what is the issue , I also tried changing the driver from ODBC Driver 17 for SQL Server to SQL Server
and got this error
Error: nanodbc/nanodbc.cpp:983: 00000: [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found
I am not sure how to resolve this, would appreciate if someone could help me using the same syntax/ library DBI::dbConnect and odbc library as I need to make some read and write to table which is very fast using dbWriteTable as my data set is huge.
List of drivers installed