Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Grouping Like Data with Database RS 1

Status
Not open for further replies.

dbrooks74

Programmer
Nov 13, 2001
105
US
Any ideas on this one??????
error '80020009'
Exception occurred.

/ToDoListing/WorkingCopyListTasks.asp, line 132
 
Can you post the code for the line where the error is occurring. If it is in relation to a recordset, it usually means that there is either no data or the field in question contains incorrect data for what you are trying to do with it.

Does that make any sense? Mighty :)
 
here is my code. I wanted to show all tasks for each users....


Set objRS = con.Execute(strconnect)
While NOT objRS.EOF
nBlackRow=0
SRSUSerNAME=objRS("USER_NAME")
Response.write &quot;<br><br><b>To Do List For &quot; & SRSUserNAME & &quot;</b><br>&quot;
response.write &quot;KEY----DESCRIPTION<br>&quot;
While objRS(&quot;USER_NAME&quot;)=SRSUserNAME
Response.write objRS(&quot;TASKS_PK&quot;) & &quot;<br>&quot;
objRS.MoveNext
Wend
Wend
 
What happens if you scrool your recordset to EOF inside the second loop? Exception :)
Took me a bit to see this one, kinda sneaky. Try using only a single loop like so:
Code:
Set objRS = con.Execute(strconnect)
While NOT objRS.EOF
   If SRSUSerNAME <> objRS(&quot;USER_NAME&quot;) Then
      Response.write &quot;<br><br><b>To Do List For &quot; & SRSUserNAME & &quot;</b><br>&quot;
      SRSUSerNAME = objRS(&quot;USER_NAME&quot;)
      response.write &quot;KEY----DESCRIPTION<br>&quot;
   End If
   Response.write objRS(&quot;TASKS_PK&quot;) & &quot;<br>&quot;
   objRS.MoveNext
Wend

This is similar to your loops but from the opposite direction. Now it loops through all the records in the loop, only writing the &quot;to do list&quot; portion wehen it comes across a new user. You should give the SRSUSerNAME an initial value jsut to make sure the first name doesn't match against it for some reason.
-Tarwn The three most dangerous things in the world are a programmer with a soldering iron, a hardware type with a program patch, and a user with an idea
-computer saying (Wiz Biz - Rick Cook)
 
That was perfect. Thanks for your help. Your code makes a lot more sense, and I no longer get error messages. Thanks. -db
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top