I\'m trying to use
odbcDriverConnect(\'driver={SQL Server};server=servername\\instancename,port;database=testing;username=abc;password=123456\')
Looks like you are trying to connect to the SQL Server. This code snippet should work, it worked for me:
library("RODBC")
connection <- DBI::dbConnect(odbc::odbc(), Driver = "SQL Server", Server = "Your Server Name", Database = "Your Database Name", UID = "Your Database Name", UID = "Your Server Login", PWD = "Your Server Password", Port = 1433)
Reference: Connecting MS SQL Server via R