Connecting to databases using RODBC on shinyapps.io

Follow

If you are using a remote database with shinyapps.io, you may need to use RODBC to connect to it in your R code. Fortunately, RODBC is installed on the shinyapps.io servers, so you'll just need to ensure that you've written your code to use the correct drivers. To do that, you'll need to ensure that you're using the FreeTDS drivers:

odbcDriverConnect('Driver=FreeTDS;TDS_Version=7.0;Server=<server>;Port=<port>;Database=<db>;Uid=<uid>;Pwd=<pw>;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;')
 
If this doesn't work with your particular database, you may need to try changing the TDS version - TDS_Version=8.0 and TDS_Version=9.0 have been successful for users in the past.
 
If you're still having issues with this or have any questions, please post them to the Posit Community site shiny topic.
 

 

Comments