|
-
Mar 14th, 2000, 10:37 AM
#1
Thread Starter
Lively Member
My source
<%
do
if rs.EOF then
rs.Close
set rs = nothing
set rs2 = nothing
exit do
end if
Response.Write ("<BR><U><STRONG style='COLOR: red'>" & rs("Cat") & "<br>")
sqlstmt = "select * from link where Cat = '" & rs("Cat") & "' ORDER BY Cat DESC "
rs2.Open sqlstmt, Conn
for x = 1 to rs2.RecordCount
if rs2.EOF then
sqlstmt = ""
rs2.Close
exit for
end if
Response.Write ("<TABLE border=1 cellPadding=1 cellSpacing=1 width='75%'>")
Response.Write ("<TR><TD><a href='" & rs2("Url") & "'>" & rs2("Name") & "'</TD></TR></TABLE>")
Response.Write ("<TABLE border=0 cellPadding=1 cellSpacing=1 width='90%'>")
Response.Write ("<TR><TD style='HEIGHT: 20px; WIDTH: 5%' width='5%' height=20></TD>")
Response.Write ("<TD>" & rs2("Desc") & "</TD></TR></TABLE><br>")
rs2.MoveNext
next
rs.MoveNext
loop
%>
It runs great with the first time in the rs2.open. but when it loop for the second time with rs2.open it gives me the following error...
ADODB.Recordset error '800a0e79'
The operation requested by the application is not allowed if the object is open.
/linkview.asp, line 68
-
Mar 15th, 2000, 12:31 AM
#2
Try somehting like this:
Code:
<%
'I assume that you have rs open somewhere else...
Do Until rs.Eof
Response.Write ("<BR><U><STRONG style='COLOR: red'>" & rs("Cat") & "<br>")
sqlstmt = "select * from link where Cat = '" & rs("Cat") & "' ORDER BY Cat DESC "
rs2.Open sqlstmt, Conn
Do Until rs2.EOF
Response.Write ("<TABLE border=1 cellPadding=1 cellSpacing=1 width='75%'>")
Response.Write ("<TR><TD><a href='" & rs2("Url") & "'>" & rs2("Name") & "'</TD></TR></TABLE>")
Response.Write ("<TABLE border=0 cellPadding=1 cellSpacing=1 width='90%'>")
Response.Write ("<TR><TD style='HEIGHT: 20px; WIDTH: 5%' width='5%' height=20></TD>")
Response.Write ("<TD>" & rs2("Desc") & "</TD></TR></TABLE><br>")
rs2.MoveNext
Loop
rs2.Close
rs.MoveNext
Loop
%>
-
Mar 15th, 2000, 11:03 AM
#3
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|