"Exception Occured" during loop

Results 1 to 3 of 3

Thread: "Exception Occured" during loop

  1. #1
    Join Date
    Dec 1969

    Default "Exception Occured" during loop

    Why do I get this error when I try to do the following:<BR><BR>DO WHILE NOT RSCategories.EOF<BR> Response.Write rsCategories("c2.category")<BR> RSCategories.MoveNext<BR> If rsCategories("c2.category_ID") = sCategory then Response.Write "&#060;/td&#062;"<BR> If iRowTrack = 0 then Response.Write "&#060;/tr&#062;"<BR>Loop<BR><BR>THE ERROR always occurs when I try to reference the recordset after the .MoveNext command.<BR><BR>Why does this happen?

  2. #2
    Join Date
    Dec 1969

    Default Is it the field name?

    c2.category_ID is the field name in your table?

  3. #3
    Join Date
    Dec 1969

    Default RE:

    At some point, you&#039;re passing EOF and there&#039;s nothing to reference when you call rsCategories("c2.category_ID"). <BR><BR>What you may want to do is check for EOF, then do your comparison:<BR><BR>If Not RSCategories.EOF Then<BR>If rsCategories("c2.category_ID") = sCategory then Response.Write "&#060;/td&#062;"<BR>If iRowTrack = 0 then Response.Write "&#060;/tr&#062;"<BR>End If<BR><BR>Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts