Re: sometimes endless loop, sometimes not



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
>
>
>
.



Relevant Pages

  • Re: Non-rectangular 3D plot
    ... loop' properly to get x and y vectors and the z matrix. ... Roger Stafford wrote: ... rectangular space. ... There is an example of a sphere generated by 'surf' in the function reference ...
    (comp.soft-sys.matlab)
  • sql query/displaying results question
    ... I have a php page I am writing with an SQL query. ... database for a couple of fields. ... of the page and then when it starts showing results. ... it want to start at the 2nd row returned when I start my while loop to ...
    (php.general)
  • Re: sometimes endless loop, sometimes not
    ... I'm using ASP, and an ... > Access 2003 database. ... > When i surf to my page, ... > query, only other time), my page goes into an endless loop. ...
    (microsoft.public.data.ado)
  • Re: sometimes endless loop, sometimes not
    ... after the loop, or remove the On Error Resume Next, eg. ... Make sure you're running Jet 4.0 as it has row level locking rather than ... Dan ... >>> When i surf to my page, ...
    (microsoft.public.data.ado)
  • making a 3D figure out of coordinates
    ... is it possible to make a loop to find the close dots so I can make one solid piece? ... I also thought of mesh or surf but you need a grid for that and they're not on a grid. ...
    (comp.soft-sys.matlab)