In principle I should be able to write some VBA code, and run it over a VBA project to amend the project.
Scenario: A collection of databases is being moved from one server to another.
There are a lot of links from Apps to different databases in the server using ODBC.
Some are just straight connections, which should be fixable simply by updating the connection string in a system table. (tdf.connect)
Other apps may either re-link on load, or on demand using Specific Connect strings with Servers, passwords for example attached to variables (like SqlSrv1,SqlSrv2), and what I'm after is using a VBA sub to read through the VBA project, and basically automating a "find the OldServer and Replace with the new one", based on an access table:
So we want load the VBA sub into each app together with the translation table (Old and New), and then just run the sub.
Can anyone offer some tips on using VBA to modify a VBA project please?
A quick look at the Access objects, it looks as though it should be possible to loop through the Modules collection, and then find and replace. - HAS ANYONE DONE THIS??
Hope that makes sense.
Thanks
David