I am leery of any code that creates fields or changes items in a report. Have you tried to changed the location/name/schema of a database in the report using the IDE? It's not easy, and sometimes doesn't work the first time, so I would be doubtful that you can change the name / location of database.
A simpler method, which I have seen done successfully, though don't care for, is to change the ODBC connection to point to the database that you want.
The best method, IMO, is to create the dataset in your application and then to push it the report. The report doesn't know, and doesn't care where the data came from, just that the schema matches and the data is there. The report is happy, the user is happy because the correct data is in the report, and this whole issue is moot.
HTH