Unexpected Exception.

Discussion in 'ASP General' started by Devin, Oct 31, 2008.

  1. Devin

    Devin Guest

    Hi,
    I'm getting an exception error on this line:

    do while not rs.eof and ucase(rs.fields("category")) =
    ucase(holdLast)


    This error occurs on the last record in the table (mdb). I deleted
    the last few records from the table to see if it was something with
    the record. The same thing occured.


    I also response.write the values of rs.fields("category") and
    holdLast and they output the values I would expect.


    Am I going nuts?

    I don't want to post my enter page, but if the error could really go
    beyond this line then please let me know.

    Thanks for any input.


    DC
     
    Devin, Oct 31, 2008
    #1
    1. Advertising

  2. Devin

    Devin Guest

    On Oct 31, 10:38 am, Devin <> wrote:
    > Hi,
    > I'm getting an exception error on this line:
    >
    > do while not rs.eof and ucase(rs.fields("category")) =
    > ucase(holdLast)
    >
    > This error occurs on the last record in the table (mdb).  I deleted
    > the last few records from the table to see if it was something with
    > the record.  The same thing occured.
    >
    > I also response.write the values of  rs.fields("category") and
    > holdLast and they output the values I would expect.
    >
    > Am I going nuts?
    >
    > I don't want to post my enter page, but if the error could really go
    > beyond this line then please let me know.
    >
    > Thanks for any input.
    >
    > DC


    It was unrelated. This post can be deleted :)
     
    Devin, Oct 31, 2008
    #2
    1. Advertising

  3. Devin

    Bob Barrows Guest

    Devin wrote:
    > On Oct 31, 10:38 am, Devin <> wrote:
    >> Hi,
    >> I'm getting an exception error on this line:
    >>
    >> do while not rs.eof and ucase(rs.fields("category")) =
    >> ucase(holdLast)


    Both expressions are evaluated. If EOF is true, then
    rs.fields("category") will raise an error.
    Change it to:
    do while not rs.eof
    if ucase(rs.fields("category")) =ucase(holdLast) then
    end if
    rs.movenext
    loop




    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Oct 31, 2008
    #3
  4. Devin

    Bob Barrows Guest

    Devin wrote:
    > Hi,
    > I'm getting an exception error on this line:
    >
    > do while not rs.eof and ucase(rs.fields("category")) =
    > ucase(holdLast)
    >

    Oops, I should have written:

    do while not rs.eof
    if ucase(rs.fields("category")) =ucase(holdLast) then
    ...
    else
    break
    end if
    rs.movenext
    loop


    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Oct 31, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nicolas edel
    Replies:
    5
    Views:
    3,090
    Gordon Beaton
    Jul 31, 2003
  2. James Ly
    Replies:
    3
    Views:
    750
    James
    Dec 3, 2003
  3. Replies:
    2
    Views:
    12,715
  4. Teddy

    unexpected exception

    Teddy, May 25, 2005, in forum: C++
    Replies:
    3
    Views:
    1,609
    Razzer
    May 25, 2005
  5. R.A.M.
    Replies:
    4
    Views:
    9,938
    R.A.M.
    May 19, 2006
Loading...

Share This Page