With this answer, I created a report to list all the queries in the current db with their input tables / queries and their result (for Actions queries).
I was very pleased with this until I noticed that as a result, some requests were missing.
I am a little fixated 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 INNER JOIN MSysObjects ON MSysQueries.ObjectId = MSysObjects.Id logic, INNER JOIN MSysObjects ON MSysQueries.ObjectId = MSysObjects.Id sometimes does not return every row that should be.
I checked both MSysQueries and MSysObjects and made sure that I have the same object identifier -2147483618 on both sides, I made sure that MSysQueries has a row for ObjectId, where Attribute = 1, however when attaching to tables this particular row with attribute = 1 does not appear. Very strange. I tried using the inner join to replace the JOIN with the criteria by adding Val or CLng to the process, in no way. I'm lost here.
EDIT 2: Found a way to correctly "join" both tables with where CStr([Id]) = CStr([ObjectId]) .
But it really is not necessary!
source share