Re: sometimes endless loop, sometimes not
- From: "MiniMike" <MiniMike@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 16 Aug 2005 01:53:07 -0700
I am sure that RS.MoveNext is inside the loop.
But i was using On Error Resume Next, and did not check the error after
showing a record. So this was pretty helpful for me. I'll change it, and
check it again.
Thanks !
But it still confuses me a little bit; why would there be an error , and
sometimes not? Nothing (not the page, not the data, ...) has changed. Would
that be an access-bug or something?
"Daniel Crichton" wrote:
> MiniMike wrote on Tue, 16 Aug 2005 00:15:02 -0700:
>
> > I'm having this very weird problem on my website. I'm using ASP, and an
> > Access 2003 database.
> >
> > The problem is this:
> > When i surf to my page, there's usually no problem.
> > I have this select statement :
> > SQL = "Select * " _
> > & "from tblTable " _
> > & "order by intID desc"
> > Set RS = Conn.Execute(SQL)
> > If not RS.Eof Then
> > Do while not RS.Eof
> > 'show this record on the site
> > Loop
> > End if
> >
> > My recordset is loaded, and i show the records on the site. There are only
> > 4 records for now.
> >
> > But, sometimes, when i surf to my page (just the same page, just the same
> > query, only other time), my page goes into an endless loop.
> >
> > Anyone with any ideas on this? The strange thing is, though it's the same
> > page, i reacts different on different times.
>
> Are you sure you've got
>
> RS.MoveNext
>
> inside that Do ... Loop? If so, then the only other problem could be that
> you've got an error occuring, you've got On Error Resume Next in your
> script, and you're not checking for an error before the last record is moved
> past - in which case RS.Eof is still false, but every attempt to move to the
> next record fails. Try something like this:
>
> On Error Resume Next
>
> SQL = "Select * " _
> & "from tblTable " _
> & "order by intID desc"
> Set RS = Conn.Execute(SQL)
> If not RS.Eof And Err.Number = 0 Then
> Do while not RS.Eof and Err.Number = 0
> 'show this record on the site
>
> RS.MoveNext
> Loop
> End if
> RS.Close
> Set RS = Nothing
>
>
> Dan
>
>
>
.
- Follow-Ups:
- Re: sometimes endless loop, sometimes not
- From: Daniel Crichton
- Re: sometimes endless loop, sometimes not
- References:
- sometimes endless loop, sometimes not
- From: MiniMike
- Re: sometimes endless loop, sometimes not
- From: Daniel Crichton
- sometimes endless loop, sometimes not
- Prev by Date: Re: sometimes endless loop, sometimes not
- Next by Date: RE: Oracle Computed column datatype
- Previous by thread: Re: sometimes endless loop, sometimes not
- Next by thread: Re: sometimes endless loop, sometimes not
- Index(es):
Relevant Pages
|
|