PC Review


Reply
Thread Tools Rate Thread

Problem getting dependency information from a query using VBA

 
 
=?Utf-8?B?R2VvcmdlIE11cm5hZ2hhbg==?=
Guest
Posts: n/a
 
      1st Aug 2007
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
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      1st Aug 2007
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
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"George Murnaghan" <(E-Mail Removed)> wrote in
message
news:F9CB11B4-D5D4-4699-84D2-(E-Mail Removed)...
> 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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
View dependency information in Access 2003 Simon Shutter Microsoft Access 2 25th Jan 2006 10:26 PM
Dependency Error: The dependency <dll> in project <project> cannot be coppied to the run directory becuase it would conflict with dependency <dll> Jay A. Moritz Microsoft VB .NET 2 14th Apr 2005 08:57 AM
Re: query dependency tree Russell Microsoft Access Queries 0 14th Jul 2003 08:22 PM
MS Access Query Dependency Add-in Questica Microsoft Access Queries 0 9th Jul 2003 02:16 PM
Re: query dependency tree John Vinson Microsoft Access Queries 0 8th Jul 2003 07:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:41 PM.