so I have inherited an Access DB with different naming conventions applied to tables. It hurts my eyes, a开发者_如何学编程nd I want to refactor. Code isn't a problem, but what about SQL embedded in the queries?
Going to answer my own question crudely now, but can anyone come up with a better method?
You might want to check out Rick Fisher's "Find and Replace" tool. I think it would do what you want. It does search and replace throughout Access's objects: forms, reports, queries, etc. I liked it a lot when I used it several times quite a few years ago:
http://www.rickworld.com/products.html
I think there used to be at least one other similar comprehensive search and replace tool for Access databases, don't remember its name or know whether it's still around.
For Each qdf In CurrentDb.QueryDefs
CurrentDb.Execute "insert into qdfs (name, sql) select '" & qdf.Name & "','" & Replace(qdf.sql, "'", "''") & "'"
Next qdf
Then I can apply a filter to my new qdfs table, and at least figure out where I'd need to look to rename tables..
精彩评论