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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To many darn loops (sorry for the length of the post)

Status
Not open for further replies.

minoad

Programmer
Mar 28, 2001
138
0
0
US
Im at wits end here, been staring at this code for the last three hours. Basically i have a recordset that writes a table row <tr> and then checks another recordset to see if the current id in the first recordset is the same as the current id in the second recordset. If they are than another <tr> is written, if not it continues with the loop that was begun at the begging of the page. I know the problem is in the loop, but ill be damned if i can find the thing. Any help would be appreciated. The way it stands now is the first records from each loop are properly written, but i get a EOF or BOF error once they hace written. The page im working on is located at . the offending code is posted below.
The 'hello' is for debugging purposes.
Thanks
Micah A. Norman

<% do until rstask.eof %>

<tr name=&quot;<%=rstask(&quot;fldTask_id&quot;)%>&quot;>
<td>
<%=rstask(&quot;fldTask_Hours&quot;)%>
</td>
<td>
<%=rstask(&quot;fldTask_Date&quot;)%>
</td>
<td>
<%=rstask(&quot;fldTask_Name&quot;)%>
</td>
<td>
<%=rstask(&quot;fldTask_Description&quot;)%>
</td>
</tr>


<%
dim i, x1, x2
i = 1
x1 = rstask.fields(&quot;fldTask_id&quot;)
do rstasksub.eof
x2 = rstasksub.fields(&quot;fldTask2_Prinum&quot;)
if x1 = x2 then
response.write(&quot;<tr>&quot;)
response.write(&quot;<td>&quot;)
response.write(&quot;hello&quot;)
response.write(&quot;</td>&quot;)
response.write(&quot;</tr>&quot;)
elseif rstasksub.eof then
i=0
exit do
end if
rstasksub.movenext
loop
%>

<%
rstask.movenext
loop
%>
 
Sorry guys. It appears as though i am loosing my mind. Simply put an if to make sure i wsnt at eof.

thanks,

Micah a. Norman
 
sometimes just asking the question gives the answer, eh?
 
If only that could fix more of lifes little problems.

Micah A. Norman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top