Re: At wits end - code breaks even with OnError Resume Next

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: RD (progr_at_ming.zen)
Date: 03/07/05


Date: Mon, 07 Mar 2005 11:21:29 -0800

Well that's pretty much what I'm doing.

I go to a db, loop through the tables and write their names and the
name of the source db to a table. Almost none of the tables have
descriptions so I figured I could fill that in later. Then I loop
through the queries and write their names, source db names and
descriptions to a "Queries" table. And so on down the list: Forms,
Reports, etc.

The problem arises when I try to pull in the description of a query
that has no description. It looks to me like if there *is* no
description then the "Description" property never gets created. If
that's the case, I can't figure out how to check without generating
the "Property not found" error. The second I refer to the property,
the error occurs.

But, frankly, that's not really the point. I've done everything in my
power to stop Access from *breaking* to the debugger when it
shouldn't.

I guess my next step will be to try it on a different machine to see
if it's the database or my copy of Access.

On Mon, 7 Mar 2005 08:35:05 -0800, Ted Allen
<TedAllen@discussions.microsoft.com> wrote:

>Unfortunately I don't have an idea as to why your code is breaking with the
>error handler, but there is another way that you can go through the
>properties without generating the error if that helps.
>
>If you want most or all of the object properties, you can just loop through
>the properties collection and write the object name, property name and the
>property value to a log table. Later you can query out specific properties
>if you like.
>
>If you just want a few properties, you can use an if statement within your
>loop to check to see if property name is equal to one of the properties you
>are interested in, and if so log the prop name and value. Or, you could use
>a select case statement to log the value in an appropriate field if you
>wanted to do it more as a flat file.
>
>Using any of those methods, you shouldn't run into errors because you'll
>never be asking for a property that doesn't exist, you'll just be checking to
>see if the property name is equal to one or more strings.
>
>HTH, Ted Allen
>
>"RD" wrote:
>
>> There seems to be absolutely nothing I can do to keep this damn thing
>> from breaking.
>>
>> I even rebuilt the database, C&Ping the code into NotePad and C&Ping
>> it into a new module.
>>
>> Break on Unhandled Errors is Ticked.
>>
>> I have an Error handler.
>>
>> I've handled the exact error being generated.
>>
>> I've tried ignoring errors (Resume Next does nothing).
>>
>> Background:
>> I've built this db that goes to other Access dbs, enumerates their
>> tables, queries, forms, etc. and writes their names and some
>> properties into various tables.
>>
>> In these various external dbs, some tables, queries, etc. have
>> descriptions and some don't. Because the idea is to analyze these
>> other dbs, I want those descriptions if they're there. The problem
>> arises when the code hits a query that doesn't have a description. It
>> generates a Run-time Error 3270: Property not found. And I can't get
>> it to stop breaking.
>>
>> There are hundreds of queries and most of them have descriptions.
>>
>> At best my rep rides on this ...
>>
>> at worst, my job.
>>
>> A little help here?
>>
>> Thanks,
>> RD
>>
>>



Relevant Pages

  • Re: [PHP] Loop issues
    ... The reason is because the first time the while loop executes, it sets $name from unset to 'Bob' and on the second time through, it sets $name from 'Bob' to 'Alice'. ... The issue isn't just echoing in a loop, but defining an array of results to begin with. ... Below are my queries. ... Smith, James Smith. ...
    (php.general)
  • Re: [PHP] Loop issues
    ... I am having trouble trying to figure out how I should compose this loop to ... Below are my queries. ... Smith, James Smith. ... Because of this I think I need to put a loop where the echo ...
    (php.general)
  • only in vertical on continuous form?
    ... form use some queries to write each non null field to a table. ... How can i loop through the control values and read/write the records to ...
    (microsoft.public.access.forms)
  • Re: Perl DBI - How to handle large resultsets?
    ... > to the queries because I edited that out. ... This line is probably better outside the while loop; ... Again, as Xho suggests, finishshould not be called on $repo_sth. ... while loop should have eaten up the result set and caused DBI to call ...
    (comp.lang.perl.misc)
  • RE: Re: RE: Perl Question:
    ... I have a data file with about 40000 rows. ... have 10 queries as each of them are in different tables. ... Among 10 prepared statements I have 2 which are of the ... statement inside the loop of 40000. ...
    (perl.dbi.users)