Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Parse Table Names from Query Def SQL

0 views
Skip to first unread message

J@discussions.microsoft.com Leon J

unread,
Aug 28, 2008, 11:45:01 AM8/28/08
to
I would like to be able to determine all the tables that are referenced with
in a querydef (and any subqueries within it, too). Is there a written
library for this or has someone written a routine to do it?

Thanks for any help,

Leon

Alex Dybenko

unread,
Aug 28, 2008, 11:53:41 AM8/28/08
to
Hi,
I think I saw such routine in Access developers handbook, basic idea is that
you parse query SQL and get tables/queries name from there.
perhaps this will help:
http://www.vbforums.com/archive/index.php/t-314247.html

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

"Leon J" <Leon J...@discussions.microsoft.com> wrote in message
news:703644D7-E23C-47D3...@microsoft.com...

Leon J

unread,
Aug 28, 2008, 3:23:04 PM8/28/08
to
Thanks for the reply, and it's great as far as it goes. What I'm really
looking for (and couldn't find after searching for over an hour myself) is if
someome has already written the parsing code, especially with whatever
recursion or similar method that is needed to get to table names within
subqueries.

Thanks again for getting me going.

Leon J

unread,
Aug 28, 2008, 5:56:11 PM8/28/08
to
One more part of the question. Obviously, Microsoft has code to pull all the
table from data stored with the query. Since they also store the location of
the tables above the grid, I assume that it does not parse the sql to get
them. It appears to me that MS may not expose that data in dao or otherwise,
but maybe I'm missing something.
0 new messages