Search & replace SQL string

B

Brian

I need to rename a set of tables that are used in many queries in an app, and
I am getting tired of having to deal with the extra characters at the
beginning of the table names.

In each case, I will be removing the same string from the query (FYI - this
is due to an ODBC link to a DB2 DB that prepends the table name with the
schema name followed by an underscore, and these are the characters I want to
strip out).

I know how to locate the string and get the query name by looping through
the query defs collection, but how do I S & R string "ABCD_" with nothing?
 
B

Brian

Sorry about the incoherency of the initial post - I cut & pasted some of it &
sent it off before reorganizing my thoughts - here is the correct info:

I need to rename a set of tables that are used in many queries (standalone
queries as well as form RecordSources & control RowSources.

In each case, I will be removing the same string from the query. I know how
to locate the string and get the query name by looping through the query defs
collection, but how do I S & R string "ABCD_" with nothing?

I also know that it MIGHT work to turn on Name AutoCorrect temporarily,
manually rename the dozen tables, and then turn it off, but it has given me
fits every time I have left it on for any length of time. Bad idea? Good idea?

FYI - this is due to an ODBC link to a DB2 DB that by default prepends the
schema name onto the linked table name. I am getting tired of dealing with
the extra leading characters, and these are the ones I want to strip out.
 
Top