sqlrsql-serverodbcdbi

rstudio dbi odbc connect Driver for SQL Server


running the following code:

library(DBI)
conn <- DBI::dbConnect(odbc::odbc(),
                  driver = "ODBC Driver 17 for SQL Server",
                  database = "xyz",
                  server = "abc",
                  Trusted_Connection = "yes")

I get the following error message:

Error in UseMethod("odbcListObjects") : 
  no applicable method for 'odbcListObjects' applied to an object of class "Microsoft SQL Server"

any idea?


Solution

  • This issue has been addressed in the dev version of the package and will be fixed in the next release of odbc. In the meantime, you can install the dev version with devtools::install_github("r-dbi/odbc").