With the help of this answer, I created a report to list all queries in the current db, with their input tables/queries, and their output (for Actions queries).
I have been very happy with it, until I noticed that some queries are missing in the result.
I am a bit stuck on why.
Any clue ?
SELECT MSysObjects.Name AS queryName,
Mid("SelectMakTblAppendUpdateDeleteXtab 777777PassThUnion ",([msysqueries]![Flag]-1)*6+1,6) AS queryType,
src.Name1 AS [Input],
MSysQueries.Name1 AS Target,
MSysQueries.Attribute
FROM (MSysQueries INNER JOIN MSysObjects ON MSysQueries.ObjectId = MSysObjects.Id)
LEFT JOIN (SELECT * FROM MSysQueries WHERE Attribute = 5) AS src ON MSysQueries.ObjectId = src.ObjectId
WHERE (((MSysObjects.Name)>"~z") AND (MSysQueries.Attribute=1))
ORDER BY MSysObjects.Name, src.Name1
EDIT: found that against all logic, INNER JOIN MSysObjects ON MSysQueries.ObjectId = MSysObjects.Id
sometimes does not return every line it should.
I checked both MSysQueries and MSysObjects and made sure I had same object id -2147483618 on both sides, I made sure that MSysQueries has a line for that ObjectId where Attribute=1, however, when joining the tables, that specific line with attribute=1 does NOT appear. Very strange. I tried to use an inner join, to replace the JOIN by a criteria, adding Val or CLng in the process, no way. I am lost here.
EDIT 2: found a way to correctly "join" both tables by using where CStr([Id]) = CStr([ObjectId])
.
But that should really not be necessary !
Access does have a built in “dependency” feature. The result is a VERY nice tree-view of those dependencies, and you can even launch such objects using that treeview of your application to “navigate” the application so to speak.
The option is found under database tools and is appropriately called Object Dependencies.
The result looks like this:
While you don't want to use auto correct, this feature will force on track changes. If this is a large application, then on first run a significant delay will occur. After that, the results can be viewed instantly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With