I got the same error when I put below code to connect to MSSQLSERVER
library(RODBC) dbconnection <- odbcDriverConnect("Driver=SQL Server;Server=192.168.76.60; Database=kaggle;Uid=sa; Pwd=1234")
It throws me
[unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found
why did they throw this error? Answer: when we cannot specify the correct ODBC version name in the driver value.
Where can we get the name of the ODBC driver version
inside the "/ etc" folder you will find the file "odbcinst.ini", open it and check the version name
[ODBC Driver 17 for SQL Server] Description=Microsoft ODBC Driver 17 for SQL Server Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1 UsageCount=1
so I got the ODBC driver name from here, it will be "ODBC Driver 17 for SQL Server" Then I change the connection string
library(RODBC) dbconnection <- odbcDriverConnect("Driver=ODBC Driver 17 for SQL Server;Server=192.168.76.60; Database=kaggle;Uid=sa; Pwd=1234")
And it works fine
source share