I want to connect to SQL Server from Rstudio and have tried this:
conection <- dbConnect(odbc::odbc(), driver="ODBC Driver 18 for SQL Server", server="10.5.119.60:1433",database="my_database",uid="my_username", pwd="my_password")
Note: server IP is randomized for the purpose of the public post.
However, I get an error from running this code:
Error: nanodbc/nanodbc.cpp:1021: 08001: [Microsoft][ODBC Driver 18 for SQL Server]MAX_PROVS: Connection string is not valid [87].
[Microsoft][ODBC Driver 18 for SQL Server]Login timeout expired [Microsoft][ODBC Driver 18 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.
Is there something wrong with my code?