I have never had any issues with odbc and RStudio
And I don't specifically include the 2 libraries odbc and DBI. I just include plyr and dplyr and tidyr
Is there a chance that there are other libraries loaded when you are running the Rstudio test?
I did a quick test and it looks like RStudio has already included library for dbconnect. which by the way I specify in my open: DBI::dbConnect
I've never had a problem with making this connection in RStudio before. This all worked well when I last ran the process last year.
When I start RStudio, the only libraries that are loaded are stats, graphics, grDevices, utils, datasets, methods, and base. Instead of loading the odbc and DBI libraries, I tried the DBI::dbConnect that you recommended. The connection works but it's not showing any tables. Similarly, I loaded the plyr, dplyr, and tidyr libraries and tried it all again and it's still not working.
I'll try re-installing RStudio to see if that gets me anywhere.
Hi, I don't believe that re-installing RStudio will help. The key is dbListTables(con), since it is returning nothing, it means that there is nothing being returned to R itself. The one thing I can think is the cause is a change in the underlying DSN connection. If I have to guess, it is either looking at the wrong, and empty, schema, or your access rights changed. From your same machine, I would try connecting to the database from another program, and see if you get the same results. Hope this helps!
I'm able to connect to the database using the same DSN everywhere I can think of except RStudio. It'll even work in R using the same commands that are failing in RStudio.
Thanks very much. Uninstalling RStudio back to the prior version solved my problem. Is there anything I can do on my end to assist the developers with resolving this issue?
Hi, thank you for confirming. It looks like the latest version of RStudio may address the issue (RStudio & Posit Workbench Release Notes), would you mind upgrading to 2022.02.0+443? And test again? I think this entry in the notes addresses your issue.
RStudio now supports the experimental UTF-8 UCRT builds of R (#9824)
If that does work, then the advice to other developers would be to upgrade RStudio