Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 27th, 2004, 02:21 AM
Friend of Wrox
Points: 486, Level: 7
Points: 486, Level: 7 Points: 486, Level: 7 Points: 486, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: Athens, , Greece.
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???
Reply With Quote
  #2 (permalink)  
Old September 27th, 2004, 02:44 AM
Friend of Wrox
Points: 486, Level: 7
Points: 486, Level: 7 Points: 486, Level: 7 Points: 486, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: Athens, , Greece.
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. :)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:26 AM.


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