Assuming you are running Windows. When you define your dsn in Control Panel> Administrative Tools> System and Security> Data Sources (ODBC), you must select the database . If you do, your code should work properly.
So, the problem is not in your R code, but in your dsn line, which, in my opinion, does not contain a link to the required database.
source share