Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to update a table with a foreign key from another table...

Status
Not open for further replies.

fmasin

Technical User
May 3, 2002
163
GB
Hi,

I'm getting the following error....

Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/km254/Videlib/Itemview3.asp, line 26


Below is the code generating the error:

<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="connect.asp" -->
<!--#include file="log.asp" -->
<html>
<body bgcolor="#FFFFFF" text="#000000">
<p align="center"><font face="Times New Roman, Times, serif" size="4">Videlib: Item View
</font></p>

<div align="center">
<center>
<table border="1">
<%
Dim Search, Movies
Search=request.form("PickList")
'sql = "Select Title, Category_Id, Status_Id from tblItem where Item_Id =" &search
sql="SELECT tblItem.Item_Id,tblItem.Title, tblCategory.Category, tblStatus.Status FROM tblCategory INNER JOIN (tblItem INNER JOIN tblStatus ON tblItem.Status_Id = tblStatus.Status_Id) ON tblCategory.Category_Id = tblItem.Category_Id WHERE(((tblCategory.Category)='Movies'))="& search
rs.open sql,myconn,3,3
%>

<%
'create the SQL statement
'sql = "Select * from tblStock where Stock_id" & Search
' populate the recordset
'rs.open sql,myconn,3,3
' go to the first record of the recordset
rs.movefirst
' loop through all the records until the end of file
do until rs.eof
' display fields from the recordset
%><table><tr><td>
Title: <%=rs("Title")%>
</tr>&nbsp;&nbsp;
<tr><td>
Category: <%=rs("Category")
%></tr>&nbsp;&nbsp;
<tr><td>
<%'Year: <%=rs("Year")%>
</tr>&nbsp;&nbsp;
<tr><td>
Status: <%=rs("Status")%>
</tr>&nbsp;&nbsp;
<br>%>
<%

' go to the next record in the recordset
rs.movenext
' go back to the beginning of the loop
Loop
' close the recordset
rs.close
%>

</table>
<a href ='ItemSelection.asp'> Back to Item Selection </a>
<a href ='Rental.asp'> Rent Now </a>
</center>
</div>
</form>
</body>
</html>

Could someone kindly tell me why I'm getting this error?

Thanks and regards,

Francis
 
Before rs.movefirst type this condition:
Code:
if not rs.eof
before rs.close type:
Code:
end if

rsshetty.
It's always in the details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top