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!

2 recordset

Status
Not open for further replies.

nnmmss72

Programmer
May 14, 2006
110
IR
i want to have 2 recordset nested to each other, the problem is that when the sencond one will be executed and then return to first one,it would lost its record set
<%set rstmp=Objload.GetAllRec("ViewTotal",varcond)
if rstmp.recordcount >0 then
while not rstmp.eof%>
<tr class=txtfonts>
<td><input type="radio" value="<%=rstmp("Progid")%>" name="Activity2" id="Activity2"><%=rstmp("MainActv")%> </td>
<td>&nbsp;<%=rstmp("Title")%> </td>
<td>&nbsp;<%=rstmp("subTitle")%> </td>
<td>&nbsp;
<%varcond=" CongId=" & VarCongId
set rst2=Objload.GetAllRec("TblLecturer",varcond)
if rstp2.recordcount >0 then
while not rstmp2.eof
Response.Write(rst2("ModId"))
rst2.movenext
wend
end if
set rst2=nothing
%> </td>
<td ><span dir=ltr><%=rstmp("Fromtime")%>-<%=rstmp("Totime")%></span></td>
</tr>
<%rstmp.movenext
wend
end if %>

it works till it gets the second recordset , but when it ends the rst2 and then comesback to the rest of rstmp, it is closed and i get the rstmp.state = -1, what is it like this? how can i have 2 recordset nested to each other/
 
...
[red]while not rstmp2.eof[/red]
...

i dont see a rstmp2?

-DNG
 
This is another example of why it is a good idea to use Option Explicit at the top of your code. Among other things, it will toss out errors if you misspelled a variable because it will not find a declaration for it.
Code:
set [COLOR=red]rst2[/color]=Objload.GetAllRec("TblLecturer",varcond)
if [COLOR=red]rstp2[/color].recordcount >0 then
while not [COLOR=red]rstmp2[/color].eof

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top