Problem getting dependency information from a query using VBA

G

Guest

Hello there,

Using Access 2003.

When one builds a query that refers to an object X twice, Access adds a _1
to the name, so there are two objects X and X_1 in the query.

If you try to run this type of query and look at the dependencies of that
query using VBA Access quits and sends an error report.

set dependency_obj = target.getDependencyInfo
for each obj in dependency_obj.dependencies
............
next obj

Access crashes, even though there is on Error goto XXX and I get to send
error reports. From what I see it crashes when it leaves next obj line (or
if you like when it tries to execute the for each obj line on the object with
the name X_1)

I am looking for a method to either ignore the obj X_1, which I cannot see
right off because Access crashs before I can get VBA to look at the name, or
an explanation as why the on Error does not work in this instance.

Looking forward to your assistance,
Thanks
George
 
A

Allen Browne

George, IME, you have little chance of getting the dependency info to work
without crashing.

It depends on Name AutoCorrect data, which is one of the best ways of
corrupting and crashing a database that I know of. My attempts to get the
dependency info working programmatically have all ended in Access crashing.

You can circumvent the table alias if you check out the SourceTable of the
Field in the QueryDef.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top