Forums

This topic is locked

displaying sub tables from the database

Posted 21 Aug 2001 09:58:56
1
has voted
21 Aug 2001 09:58:56 ben tilford posted:
Hello All...

Here is my problem...

I am trying to display info from a sub table in my database, from a members area, but keep getting the following error message:

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/favourites/dynamic_pages/login2.asp, line 87

here is the code for this page:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/connfavourites.asp" -->
<%
Dim rsUser__varUserID
rsUser__varUserID = "1"
if (Session("svUserID" <> "" then rsUser__varUserID = Session("svUserID"
%>
<%
set rsUser = Server.CreateObject("ADODB.Recordset"
rsUser.ActiveConnection = MM_connfavourites_STRING
rsUser.Source = "SELECT UserID, UserName FROM FavesMembers WHERE UserID = " + Replace(rsUser__varUserID, "'", "''" + ""
rsUser.CursorType = 0
rsUser.CursorLocation = 2
rsUser.LockType = 3
rsUser.Open()
rsUser_numRows = 0
%>
<%
Dim rsFavouritesUrls__MMColParam
rsFavouritesUrls__MMColParam = "1"
if (Request.QueryString("UserID" <> "" then rsFavouritesUrls__MMColParam = Request.QueryString("UserID"
%>
<%
set rsFavouritesUrls = Server.CreateObject("ADODB.Recordset"
rsFavouritesUrls.ActiveConnection = MM_connfavourites_STRING
rsFavouritesUrls.Source = "SELECT SubHyperlinkID, HyperlinkName, HyperlinkAddress, HADescription, UserID FROM MemberUrls WHERE UserID = " + Replace(rsFavouritesUrls__MMColParam, "'", "''" + " ORDER BY SubHyperlinkID ASC"
rsFavouritesUrls.CursorType = 0
rsFavouritesUrls.CursorLocation = 2
rsFavouritesUrls.LockType = 3
rsFavouritesUrls.Open()
rsFavouritesUrls_numRows = 0
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "" Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "" Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "" Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "" Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "" Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<html>
<head>
<title>>>> Favouritesonline.com - Login2 <<<</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
If Request.Cookies("ckLoggedin" <> "Loggedin" Then
Response.Redirect "login.asp"
End If
%>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello <%=(rsUser.Fields.Item("UserName".Value)%> ! <a href="logout.asp">Log out</a> if you are not <%=(rsUser.Fields.Item("UserName".Value)%></p>
<p> </p>
<table width="200" border="1">
<tr>
<td><%=(rsFavouritesUrls.Fields.Item("HyperlinkName".Value)%></td>
<td> </td>
</tr>
<tr>
<td><%=(rsFavouritesUrls.Fields.Item("HyperlinkAddress".Value)%></td>
<td> </td>
</tr>
<tr>
<td><%=(rsFavouritesUrls.Fields.Item("HADescription".Value)%></td>
<td> </td>
</tr>
</table>
<p> </p>
</body>
</html>
<%
rsUser.Close()
%>
<%
rsFavouritesUrls.Close()
%>

Any help would be great...

Cheers...Ben...

Reply to this topic