As mentioned in
Databaseconnections, there are various ways to connect at runtime. For multi-database applications, you must decide which technique to use.
When connecting in the run-time environment, you must use the same logical database names that you used during compilation. If you need to use a different logical database name for some reason, you may add an alias to the database to allow r-code files with other names to run.