odbc connect error for Rstudio connnection to SQL Server with Windows Authentication

Error: nanodbc/nanodbc.cpp:950: HY000: [unixODBC][RStudio][SqlServerODBC] (0) Failed to connect to the SQL Server instance: Server not found.

I am new to using RStudio for connection to SQL Server. We have Windows Authentication and I tried the code below and the error posted in the topic is what I am getting. I am completely lost. Please help.

con <- dbConnect(odbc(),
Driver = "sqlserver",
Server = "prodedw2",
Database = "DataWarehouse",
Trusted_Connection = "True")

I also tried using a User DSN and get a similar error.
con <- dbConnect(odbc(), "EDWProd")
Error: nanodbc/nanodbc.cpp:950: IM002: [unixODBC][Driver Manager]Data source name not found, and no default driver specified

Are you on windows? You might want to read this thread. There are a lot og great links to learn more.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.