You have the DSN defined in your local environment, that is why you can simply call it by name, but that DSN is not defined on the shinyapps.io servers so you need to specify the connection parameters like which driver to use, the server ip, your credentials, etc.
Also, please be aware of our cross-posting policy
https://stackoverflow.com/questions/74210574/shiny-app-isnt-working-with-odbc-data-base-connection-after-being-deployed
Posting the same question both here and on other sites
Posting the same question to multiple forums at the same time is often considered impolite. We don't completely ban such cross-posting, but we ask you to think hard before you do it and to follow some rules.
Cross-post sparingly
Rather than post the same thing here and elsewhere from the get-go, post in one place at a time. Let enough time go by (think days, not hours) before you take your question somewhere else. Sometimes people at another site may suggest you post here if your question doesn't fit within the scope of the other site.
Always link to your other posts, and update everywhere with any solution…