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