Subject: problem with Recordset
Posted By: Varg_88 Post Date: 9/27/2004 2:21:38 AM
Hello Guyz... I`ve the following problem when I`m trying to have 2 "while" functions.

The code I`m using is as follows:
-------------------
<%
Dim fr, oRSbn
Set fr=server.createobject("ADODB.recordset")
Set oRSbn=server.createobject("ADODB.recordset")


sqltext = " SELECT * from user_id ;"
fr.open sqltext, "DSN=My_proj"
Do while NOT fr.eof
id = fr("unique_id")
response.write "<tr>"
    response.write "<td>"
    response.write fr("u_name")
    response.write " "
    response.write fr("u_surname")
    response.write "</td>"


hi = " SELECT * from University_grade WHERE Unique_Id ="& id &";"
oRSbn.open hi, "DSN=My_proj"
Do while NOT oRSbn.eof
    response.write "<td>"
    response.write oRSbn("Title_grade")
    response.write "<br>"
    response.write oRSbn("grade")
    response.write "<br>"
    response.write oRSbn("institute")
    response.write "<br>"
    response.write oRSbn("country")
    response.write "</td>"
oRSbn.movenext
loop
%>

<%
fr.movenext
loop

%>
--------------------

The problem that occurs is the following :
------
Error Type:
ADODB.Recordset (0x800A0E79)
Operation is not allowed when the object is open.
------

So, is there a problem with my code? Or should I use a different function???
Reply By: Varg_88 Reply Date: 9/27/2004 2:44:12 AM
I solved the problem... The problem was that I forgot the following line:
-----------
oRSbn.Close
-----------
after the second loop. :)

Go to topic 19684

Return to index page 763
Return to index page 762
Return to index page 761
Return to index page 760
Return to index page 759
Return to index page 758
Return to index page 757
Return to index page 756
Return to index page 755
Return to index page 754