Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mass update of queries

Status
Not open for further replies.

hmstoo44dd

Programmer
Sep 27, 2002
32
US
Is there a way to loop through all of my queries and if they use a specific table, change them to point to a different table or query?

I'm trying to integrate my access database with a table in SQL Server that contains same data with different column names.
 
dim qdefs as querydefs
dim qdef as querydef
Set qdefs = currentdb.querydefs
for each qdef in qdefs

qdef.sql=replace(qdef.sql,oldtablename,newtablename)

nexr
 
Thanks pwise. I found an easy way to update without code. I made a copy of the database, deleted the old table, linked to the new SQL Server table, created a query and aliased the column names, then named the query the name of the old table. Works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top