Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 27th, 2004, 02:21 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 105
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with Recordset

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???
 
Old September 27th, 2004, 02:44 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 105
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I solved the problem... The problem was that I forgot the following line:
-----------
oRSbn.Close
-----------
after the second loop. :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with recordset rwahdan BOOK: Access 2003 VBA Programmer's Reference 1 March 13th, 2008 05:03 AM
Recordset Problem hugoscp Classic ASP Professional 0 July 10th, 2007 05:59 AM
recordset problem jdsflash ASP.NET 1.0 and 1.1 Basics 1 May 16th, 2006 11:49 AM
Problem with recordset am_po_28 Pro VB 6 1 August 25th, 2003 10:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.