Print Page | Close Window

filter recordset via Author_ID

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=9271
Printed Date: 07 April 2026 at 6:54pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: filter recordset via Author_ID
Posted By: zerohero
Subject: filter recordset via Author_ID
Date Posted: 26 January 2004 at 9:13pm

hi all...

i have intergrated the WWF database into my own...i am now atempting to filter recordsets via the Author_ID from the cookie produced from the login...

i am using UDev... and am familiar with how to filter recordsets via a cookie... but i dont know what the cookie is called to filter on...?

can some one help me out as i dont where to start...

cheers... 




Replies:
Posted By: WebWiz-Bruce
Date Posted: 27 January 2004 at 3:30am
The author ID is not stored in the cookie as this would be a seurity risk.

The user is tracked using cookies which containb a unique security code generated for each user.

The cookie is called WWF and the User code is UID


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: zerohero
Date Posted: 27 January 2004 at 4:58am

thanks 4 the reply...

i am using WWF v7.1 and i found the code requesting the cookie and it is called "Forum" ...is this correct?

i have tried to filter on the Forum... here is the code UD generates:

<%
Dim rsTestCookieFilter__MMColParam
rsTestCookieFilter__MMColParam = "1"
if (Request.Cookies("Forum")  <> "") then rsTestCookieFilter__MMColParam = Request.Cookies("Forum")
%>
<%
set rsTestCookieFilter = Server.CreateObject("ADODB.Recordset")
rsTestCookieFilter.ActiveConnection = MM_connNightOwls_STRING
rsTestCookieFilter.Source = "SELECT *  FROM tblAuthor  WHERE User_code = '" + Replace(rsTestCookieFilter__MMColParam, "'", "''") + "'"
rsTestCookieFilter.CursorType = 0
rsTestCookieFilter.CursorLocation = 2
rsTestCookieFilter.LockType = 3
rsTestCookieFilter.Open()
rsTestCookieFilter_numRows = 0
%>

but i getthe following error:

ADODB.Field error '800a0bcd'

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

/leedsnightowls/forum/TMP1xawcs57nu.asp, line 26

any ideas what im doin wrong...?

cheers...



Posted By: WebWiz-Bruce
Date Posted: 27 January 2004 at 5:25am
Version 7.1 did have a different name for the cookie, you should really update to the latest version for security reasons.

That code produced by Dreamweaver looks like some of the worse code I have ever seen, DW is not very good with anything part from HTML coding, even thats not always good though.

If I where you I would scrape it and start again writting it by hand.

Have a look at the tutorial on databases in the ASP section of this site.

You can even look at the code in the file common.asp on teh forum and see how that reads in the cookie and matches it up to a database record.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: zerohero
Date Posted: 27 January 2004 at 8:11am

cheers...

i will upgrade when i hav resolved this issue...

i have done the tutorial understood it and got the following page to read the db:

<mailto:%@LANGUAGE="VBscript"%'>%@LANGUAGE="VBSCRIPT"%>
<!--#include file="common.asp" -->
<html>
<head>
<title>testCookieFilter</title>
</head>
<body bgcolor="white" text="black">
<%
'Dimension variables

Dim rsMembers  'Holds the recordset for the records in the database


'Create an ADO recordset object
Set rsMembers = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblAuthor.Username, tblAuthor.User_code FROM tblAuthor;"

'Open the recordset with the SQL query
rsMembers.Open strSQL, adoCon

'Loop through the recordset
Do While not rsMembers.EOF
 
 'Write the HTML to display the current record in the recordset
 Response.Write ("<br>")
 Response.Write (rsMembers("Username"))
 Response.Write ("<br>")
 Response.Write (rsMembers("User_code"))
 Response.Write ("<br>")

 'Move to the next record in the recordset
 rsMembers.MoveNext

Loop

'Reset server objects
rsMembers.Close
Set rsMembers = Nothing
Set adoCon = Nothing
%>
</body>
</html>

so from here... how would i get filter the rs with the user_code...?

any help gratefully accepted...ta...



Posted By: WebWiz-Bruce
Date Posted: 27 January 2004 at 12:42pm
I'm not sure what you mean by filter, you are not filtering anything and certainly not the recordset.

What you need to do is just write an sql statement that gets the members details from the authors table.

SELECT * FROM tblAuthor WHERE User_code = '" & strLoggedInUserCode & "';"

The query will get the corresponding record from the database, if no record is returned then the database then the person has altered the cookie on their machine and is tring to hack the board.




-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net