If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ADODB.Recordset (0x800A0CC1)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-23-07, 17:17
db_novice01 db_novice01 is offline
Registered User
 
Join Date: Mar 2007
Posts: 2
ADODB.Recordset (0x800A0CC1)

I am completely new to ASP and no wonder it is proving challenging.
I am writing a small application that enables users search for courses...unfortunately am getting an error I can't resolve as show below together with the asp code (error first followed by asp code). I need help. Thanks.

# Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/asp/isy5v98_find_details.asp, line 60

# Browser Type:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

# Page:
POST 59 bytes to /asp/isy5v98_find_details.asp

# POST Data:
selectedcourseno=isy320&selectedyear=1999&selected term=fall

# Time:
Friday, March 23, 2007, 3:53:19 PM

# More information:
Microsoft Support

The asp code is below:

<html>

<title>
Search Result
</title>

<body>
<%
'========================================
'Define an ADO connection object
Dim connection
Set connection = Server.CreateObject("ADODB.Connection")
'=======================================
'Define a connection string and set its value
Dim connectionstring
connectionstring = "dsn=oracle_student1_dsn; pwd=nathan"
'=======================================
'Open the connection to the database using the connection string information
connection.open connectionstring
'=======================================
'Define an ADO recordset object that will contain rows retrieved from query
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
'=======================================
'Define a variable to store the query and create the query
Dim strSQL
if len(trim(request("selectedyear"))) < 1 then
strSQL = "select * from section s, course c" & _
" where s.courseno = '" & request("selectedcourseno") & _
"' and term = '" & request("selectedterm") & _
"' and s.courseno = c.courseno;"
else
strSQL = "select * from section s, course c" & _
" where s.courseno = '" & request("selectedcourseno") & _
"' and year = " & trim(request("selectedyear")) & _
" and term = '" & request("selectedterm") & _
"' and s.courseno = c.courseno;"
end if

'=======================================
'Open the recordset object to run the query and retrieve the recordset
objRS.Open strSQL, connection

'if no records returned, then inform the user
if objRS.eof then
response.write ("Course Not Found")
else

'as long as there are records, process them
do while not objRS.eof

'return info on each course to the browser
response.write ("Call Number: " & objRS("callno") & "<br>")
response.write ("Course Number: " & objRS(1) & " " & objRS("name") & "<br>")
response.write ("Term: " & objRS("term") & "<br>")
response.write ("Year: " & objRS("year") & "<br>")
response.write ("Time: " & objRS("time") & "<br>")
response.write ("Days: " & objRS("days") & "<br>")
response.write ("Room Number: " & objRS("roomno") & "<br>")
response.write ("Maximum Number of Students Allowed in Class: " & objRS("maxallowed") & "<br>")
response.write ("Instructor's ID: " & objRS("prof_id") & "<br>")
response.write ("************************************************ ****" & "<br>")

'move the pointer to the next row in the recordset
objRS.movenext

'loop back to process the next row
loop
end if

'come here when EOF reached
'done processing rows
'==============================
'close recordset and connection objects
objRS.close
set objRS = nothing
'==============================
connection.close
set connection=nothing
'==============================
'end vbscript code
%>

</body>
</html>
Reply With Quote
  #2 (permalink)  
Old 03-23-07, 17:51
pbaldy pbaldy is offline
Registered User
 
Join Date: May 2005
Location: Nevada, USA
Posts: 2,475
If my math is correct, this is line 60 (the line with an error):

response.write ("Room Number: " & objRS("roomno") & "<br>")

So the error implies that "roomno" is not a field in the recordset. Is it?
__________________
Paul
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On