Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - How to get lastest post
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to get lastest post

 Post Reply Post Reply
Author
Ramil View Drop Down
Newbie
Newbie


Joined: 12 April 2003
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ramil Quote  Post ReplyReply Direct Link To This Post Topic: How to get lastest post
    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

 

 

 

Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2003 at 2:27am

You need to declare variables befoe using them:-

Dim rsStatistics

Back to Top
zadax View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 19 January 2003
Location: Israel
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote zadax Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2003 at 7:33am

go to ur languge file and Add this line :

Dim rsStatistics = "Statistics"

Back to Top
Pure P10 View Drop Down
Newbie
Newbie


Joined: 28 April 2003
Location: United Kingdom
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pure P10 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Zamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 27 February 2003
Location: Netherlands
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Zamal Quote  Post ReplyReply Direct Link To This Post 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



Edited by Zamal
Back to Top
Pure P10 View Drop Down
Newbie
Newbie


Joined: 28 April 2003
Location: United Kingdom
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pure P10 Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2003 at 9:28am

Thanks that is just what I wanted

Your the tops

Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2003 at 1:29pm
Back to Top
cybermaster View Drop Down
Groupie
Groupie


Joined: 31 August 2002
Location: Croatia
Status: Offline
Points: 91
Post Options Post Options   Thanks (0) Thanks(0)   Quote cybermaster Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.