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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find all the references of a table or query

Status
Not open for further replies.

dpimental

Programmer
Jul 23, 2002
535
US
I remember coming across some code that would be able to search system tables which would allow you to search for every reference of a table or query in the database.

Does anyone know / have similar code.

Is there a tool / utility that would do the same thing?

David Pimental
(US, Oh)
 
Perhaps something on these lines may help:

Code:
PARAMETERS TableOrQuery Text ( 255 );
SELECT MSysQueries.ObjectId, MSysObjects.Name, MSysQueries.Name1, MSysQueries.Name2, MSysQueries.Expression, MSysObjects.Type
FROM MSysQueries RIGHT JOIN MSysObjects ON MSysQueries.ObjectId = MSysObjects.Id
WHERE (((MSysQueries.Expression) Like "*" & [TableOrQuery] & "*") AND ((MSysObjects.Type) In (1,4,5,6))) OR (((MSysObjects.Name) Like "*" & [TableOrQuery] & "*") AND ((MSysObjects.Type) In (1,4,5,6)));

 
Remou, what is Name, Name1, Name2, Expression and Type?

David Pimental
(US, Oh)
 
Name1 and Name2 are tables to be joined, however, the names should also occur in Expression. Type is the object type, where 1, 4 and 6 are table types and 5 is a query.

 
Is there a way to do the following (some of which you already provided).

1. provide a table and produce a list of queries from that.

2. provide a table / query and produce a list of forms or reports from that

3. provide a table / query field and find all the queries, forms, reports where it is used.

#3 is not really imperative, it would be nice to have.

Any takers?

David Pimental
(US, Oh)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top