Print Page | Close Window

How to get lastest post

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=2219
Printed Date: 31 March 2026 at 3:19am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: How to get lastest post
Posted By: Ramil
Subject: How to get lastest post
Date Posted: 27 April 2003 at 6:20pm

Anyone please help me!  WWF V.7.0

I have problem with an error when I tried to get 6 lastest post from database to show on default page.

Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'rsStatistics'

below is code from default.asp of V.6.34; [I copy to place in V.7.0]

<%

'Get the latest forum posts
'Intialise the ADO recordset object
Set rsStatistics = Server.CreateObject("ADODB.Recordset")

'Cursor type to one to count
rsStatistics.CursorType = 1
 
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Top 6 tblTopic.Forum_ID, tblTopic.Topic_ID, tblTopic.Subject, tblForum.Password, tblForum." & strMemberStatus & " "
strSQL = strSQL & "FROM tblForum INNER JOIN tblTopic ON tblForum.Forum_ID = tblTopic.Forum_ID "
strSQL = strSQL & "WHERE ((tblForum.Password) Is Null) "
'As long as the user is not the admin don't display a post unless they have permission to view it
If lngLoggedInUserID <> 1 Then
 strSQL = strSQL & " AND (tblForum." & strMemberStatus & " < 3) "
End If
strSQL = strSQL & "ORDER BY tblTopic.Last_entry_date DESC;"
  
'Query the database
rsStatistics.Open strSQL, strCon

'If EOF then display an error message
If rsStatistics.EOF Then Response.Write "<span class=""text"">" & strTxtNoForumPostMade & "</span>"
 
'If there are pages to display then display them
Do while NOT rsStatistics.EOF
 
%>
<a href="display_topic_threads.asp?ForumID=<% = rsStatistics("Forum_ID") %>&TopicID=<% = rsStatistics("Topic_ID") %>&PagePosition=1" target="_self">
<% = rsStatistics("Subject") %></a><br>

<%
 rsStatistics.MoveNext
Loop

'Close the recordset
rsStatistics.Close

%>

Thanks for Kindly help

 

 

 




Replies:
Posted By: WebWiz-Bruce
Date Posted: 28 April 2003 at 2:27am

You need to declare variables befoe using them:-

Dim rsStatistics



-------------
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: zadax
Date Posted: 28 April 2003 at 7:33am

go to ur languge file and Add this line :

Dim rsStatistics = "Statistics"



Posted By: Pure P10
Date Posted: 28 April 2003 at 9:03am

I get this error

Forum Statistics

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'rsStatistics'

/purep10/forum/default.asp, line 440

 

Any help very welcome



Posted By: Zamal
Date Posted: 28 April 2003 at 9:23am

Here is a version of default.asp which displays the 5 latest posts taking into account the read permissions the user has got. Pasworded forums are skipped.

http://123pc224.sshunet.nl/wwfmods/Latestposts.zip - http://123pc224.sshunet.nl/wwfmods/Latestposts.zip



Posted By: Pure P10
Date Posted: 28 April 2003 at 9:28am

Thanks that is just what I wanted

Your the tops



Posted By: MadDog
Date Posted: 28 April 2003 at 1:29pm
For future referrence... http://www.maddogs-asp.com/show_tutorial.asp?TutorialID=247 - http://www.maddogs-asp.com/show_tutorial.asp?TutorialID=247

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: cybermaster
Date Posted: 28 April 2003 at 1:43pm
i'm making mod wich one will display on default.asp nline users and members that hawe visit forum today...

sorry on bad english



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