homepage Welcome to WebmasterWorld Guest from 54.205.254.108
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
ADODB.Recordset error '800a0cc1'
zaxzax




msg:3930249
 9:37 am on Jun 10, 2009 (gmt 0)

Can anyone help me out here..
I trying to resolve this error here

ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/Apps/Reservation/asp/Reserve.asp, line 86

Here is the vb code

<%
response.write "<body ><div class='heading1'> Processing Request ... pls wait ... </div>"
Dim intStaffId
Dim rst2
Dim from_date
Dim to_date
'Dim objRS
'Dim strsql
Dim i,j
Dim target
Dim SQLQuery2
Dim stime, etime, flag, ustime, uetime
Dim inv_no
Dim intRefId
Dim arr(10,10)
Dim strArr
Dim blnAvailable
flag = 0
blnAvailable = false
intStaffId = Request.form("cboUser")
ustime = Request("starttime") 'User Start Time
uetime = Request("endtime") 'User End Time
if session("type")="1" then
intRefId=Request.form("notebook")
elseif session("type")="2" then
intRefId=Request.form("room")
elseif session("type")="3" then
intRefId=Request.form("projector")
end if
Set rst2 = Server.CreateObject("ADODB.Recordset")
from_Date=request("txt_FromDate")
from_Date=from_date

to_Date=request("txt_ToDate")
to_date=to_date

'Response.End
'if WeekDay(from_date) = "1" or WeekDay(from_date) = "7" then
' DisplayMessage "Sorry! Bookings cannot start on a Saturday or a Sunday. Please choose a different date.","javascript:history.back();"
' response.end
'end if
'if WeekDay(to_date) = "1" or WeekDay(to_date) = "7" then
' DisplayMessage "Sorry! Bookings cannot end on a Saturday or a Sunday. Please choose a different date.","javascript:history.back();"
' response.end
'end if
if session("type")=1 then
strSQL="Select inv_no from tbl_notebookdetails where status=1 and inv_no = " & intRefId
elseif session("type")=2 then
strSQL="Select reference_id inv_no from tbl_roomdetails where reference_id = " & intRefId
elseif session("type")=3 then
strSQL="Select reference_id inv_no from tbl_projectordetails where reference_id = " & intRefId & " and status=1 order by rank"
end if
gf_openRecordset strsql, objrs, objConn

j=0
while not objRs.eof
if cdate(To_Date)=cdate(from_Date) then
' Target=1
Target=0
else
Target=(cdate(To_Date) - cdate(from_Date))
ustime = 0 'User Start Time
uetime = 19 'User End Time
end if
Dim nextDate
for i=0 to Target
nextDate = CDate(from_date) + i
' Response.Write nextDate
SQLQuery2 = "SELECT * from Tbl_Notebook where Inv_no=" & objRs("Inv_no") & " and Start_Dt=convert(datetime,'" & Day(nextDate) & "/" & Month (nextDate) & "/" & Year(nextDate) & "',103) and End_Dt=convert(datetime,'" & Day(nextDate) & "/" & Month (nextDate) & "/" & Year(nextDate) & "',103) and Type=" & session("type") & " order by Start_Time" <- this is the line for the error
' response.write sqlQuery2 & "<br>"

Set rst2 = objConn.Execute(SQLQuery2)
If not rst2.eof then
Do While Not rst2.EOF
stime = rst2("start_time")
etime = rst2("end_time")
if CInt(ustime) = CInt(stime) then
flag = 1
elseif CInt(ustime) >= CInt(stime) AND CInt(uetime) <= CInt(etime) then
flag = 1
elseif CInt(ustime) >= CInt(stime) AND CInt(ustime) < CInt(etime) then
flag = 1
elseif CInt(ustime) =< CInt(stime) AND CInt(uetime) > CInt(etime) then
flag = 1
elseif CInt(ustime) =< CInt(stime) AND CInt(uetime) <= CInt(etime) AND CInt(uetime) > CInt(stime) then
flag = 1
End If
rst2.MoveNext
Loop
end if
next
if flag=1 then
arr(j,0)=objRs("inv_no")
arr(j,1)=1
else
arr(j,0)=objRs("inv_no")
arr(j,1)=0
end if
flag=0
j=j+1
objRs.movenext()
wend

for i=0 to j-1
if arr(i,1)=0 then
strArr = arr(i,0)
blnAvailable = true
objRs.movelast()
end if
next
if not blnAvailable then
Response.Redirect("unavailable.asp")
end if

Thanks.

 

mattglet




msg:3931146
 11:24 am on Jun 11, 2009 (gmt 0)

You don't show where line 86 is, so it's rather tough to exactly know the answer.

However, that error message is most common when trying to reference a recordset column that doesn't exist. In your case, I would look to see if rst2("start_time"), rst2("end_time"), and objRs("inv_no") exist in your database table.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved