Re: Renaming
- From: "BillCo" <coleman.bill@xxxxxxxxx>
- Date: 25 May 2006 00:39:53 -0700
These days, if you open Tools | Options, go to the General tab, and check
everything under Name Auto Correct
apart from turning the app into a scene from cocoon, name auto correct
only goes so far. would be ok if it didnt have any forms or reports or
code or macros.
First question, when you say that you are changing "queries that refer to
it", do you mean that you are opening the querydef, parsing the SQL, and
replacing old table names with new table names? If not, then you're going
to be in for a shock the first time you try to run a query and find out that
your tables (as named in the queries) do not exist.
....hmm didnt read the code i posted then ;)
For each table whose name just must change, I'd create a query that selects<snip>
from the old name and save the query as the new name. Each query is just
"Select t.* From oldtablename As t". That's it. Now I have all the lovely
new table names in place and haven't butchered anything in my application.
and then start removing the queries and renaming old tables to their new names.
doubling the number of queries (already at 600ish) with a cryptic
naming scheme only to remove them again is not really a runner, this
will only hide problems that will surface once the queries are removed
and greatly complicate things along the way.
Next, I might use some vb to open forms or reports in design view and notice
if the recordsource is one of the old names. When I find one, I would
simply replace it with the new name.
seriously, dude - READ THE CODE!!!! it takes care of all of that -
querydefs, forms, reports, recordsources, control sources...
msysobjects and msysqueries so<snip>
even create a form with a listboxes to display the list of all queries, and use code for
instance in a double-click event to open the query in design view, etc etc.
....or i could select a query in the db window and click edit... (which
i dont even need to do because i've already looped through them all in
code and changed them)
make a list of public constants set to the table names and replace
hard-coded referenes to name strings with references to the costants.
you mean:
Public Const pStrTblMyTableName = "tblMyTableName"
so that i can change this to to:
Public Const pStrTblMyTableName = "tblNOTMyTableName"
....seriously, trying to clear things up here. Unify, homognise and
simplify.
ok, I appreciate your attempting to help here - you didnt have to
reply, so thanks for your time. But next time you feel moved to offer
your tupence, RTFP... I'll check out speed ferret thanks. That might
have what I need for code and macros. if not, there's always find and
replace - i was just trying to create a on click comprehensive solution
to table renaming.
.
- Follow-Ups:
- Re: Renaming
- From: Larry Linson
- Re: Renaming
- Prev by Date: Re: Norcal user group?
- Next by Date: Re: CrossTab Query with Parameter
- Previous by thread: Re: Renaming
- Next by thread: Re: Renaming
- Index(es):
Relevant Pages
|