Connecting R to SQL server management studio 19

Connecting R to SQL server management studio 19

I was trying to connect R to SQL server management studio and its always throwing me the below error 08001 . below is my code

conn1 <- DBI::dbConnect(
odbc(),
Driver="ODBC Driver 18 for SQL Server",
Server="servername\database",
Database="database",
Trusted_Connection= "True",
)

error -
Error in DBI::dbConnect():
! ODBC failed with error 08001 from [Microsoft][ODBC Driver 18 for SQL Server].
:multiply: Invalid value specified for connection string attribute 'Trusted_Connection'
:information_source: From nanodbc/nanodbc.cpp:1150.
Run rlang::last_trace() to see where the error occurred.

Can anyone please help me with this

Have you tried Trusted_Connection = "yes"?

yes, I have and found the root cause. it worked when I eliminated the database and added UID, PWD & replaced Trusted_Connection with TrustServerCertificate.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.