Mark A Matte
markamatte at hotmail.com
Wed Feb 9 11:43:32 CST 2005
Lambert, The 'Resume Next' seemed to take care of it. The code didn't have a problem getting the name of the protected folder...it was when it tried to get the subfolders from the protected folder that the problem occurred. I'm not going to kill my brain trying to figure out why it ignored the error handler...I'll just move on and accept the mystery. Thanks, Mark >From: "Heenan, Lambert" <Lambert.Heenan at aig.com> >Reply-To: Access Developers discussion and problem >solving<accessd at databaseadvisors.com> >To: "'Access Developers discussion and problem >solving'"<accessd at databaseadvisors.com>, "'Mark A Matte'" ><markamatte at hotmail.com> >Subject: RE: [AccessD] Code forgets error handlers? >Date: Wed, 9 Feb 2005 12:12:33 -0500 > >Without seeing the code it's hard to be sure what's going on. But one small >suggestion, would > >On Error Resume Next > >work any better? Of course it depends on what comes after the Dir() line. > >BTW, here is my "is it a directory" function... > >Function isDirectory(sDir As String) As Boolean > On Error Resume Next > isDirectory = (GetAttr(sDir) And vbDirectory) <> 0 > If Err.Number <> 0 Then isDirectory = False > On Error GoTo 0 >End Function > >This does not error out when looking at a folder to which I have no access. >Instead it just returns True. > >Lambert > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte > > Sent: Wednesday, February 09, 2005 11:53 AM > > To: accessd at databaseadvisors.com > > Subject: [AccessD] Code forgets error handlers? > > > > Hello All, > > > > The recent thread about selecting directories made me break out a tool I > > used to find all folders and subfolders on a drive...and then find all > > files > > of a certain type in those folders. The problem I ran into as the code > > was > > looping through was when it used the Dir() function to determine if it >was > > a > > directory...and it turned out to be protected or I didn't have access to > > it. > > I would get an error that the path did not exist. So I put in error > > handlers...On Error GOTO "skip"...just something to goto the next >record. > > > > This works fine...but after a couple hundred loops...the code 'forgets' > > about the GOTO and just gives me the error. This is A97 on a NT >machine. > > I > > thought I might be missing something because it was a loop...I even put > > the > > GOTO at the beginning and end of loop and function...Any ideas? > > > > Thanks, > > > > Mark > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com