How to find all queries related to table in MS Access

shanmugamgsn picture shanmugamgsn · Oct 20, 2011 · Viewed 36.6k times · Source

I have a database. In this i have hundreds of tables,macros and forms. No my problem is i have to find what all queries,macros that are related to specific table.

I'm using microsoft acess 2000.

But i even i tried objet dependencies in access 2007, it showed plenty of errors and close automatically.

Is this there any easy way to get this???

Thanks, Shanmugam

Answer

Igor Turman picture Igor Turman · Oct 20, 2011

You can try to execute SQL Query against system tables directly to get dependencies that are shown in 2003+ versions in more user-friendly way. I am not sure if that works on 2000 (it does in 2003+) but it is worth trying:

SELECT DISTINCT MSysObjects.Name
FROM MSysQueries INNER JOIN MSysObjects ON MSysQueries.ObjectId=MSysObjects.Id
WHERE (((MSysQueries.Name1) Like "*" & [TableName] & "*")) OR (((MSysQueries.Name2) Like "*" & [TableName] & "*"))

You may need to check if you have permissions to access system tables...

Hope this helps