|
right I've figured out my above problem... but now I have another :-(
Underneath each post I need to also show the date it was posted and who posted it...
My current script looks like:
<% Dim rsLastestPosts
Dim strSQL
'Create a connection odject Set adoCon = Server.CreateObject("ADODB.Connection")
'Database connection info and driver strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=; DBQ=" & Server.MapPath("forum/admin/wwForum.mdb")
'Set an active connection to the Connection object adoCon.Open strCon
Set rsLastestPosts = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT Top 1 tblForum.*, tblTopic.*, tblThread.Author_ID, tblAuthor.Username " strSQL = strSQL & "FROM (tblForum INNER JOIN tblTopic ON tblForum.Forum_ID = tblTopic.Forum_ID) INNER JOIN (tblAuthor INNER JOIN tblThread ON tblAuthor.Author_ID = tblThread.Author_ID) ON tblTopic.Topic_ID = tblThread.Topic_ID " strSQL = strSQL & "WHERE ((tblForum.Password) Is Null) AND tblTopic.Forum_ID = 2 " strSQL = strSQL & "ORDER BY tblTopic.Last_entry_date DESC;"
rsLastestPosts.Open strSQL, strCon
If rsLastestPosts.EOF Then Response.Write "<span class=""smltext"">No Forum Posts Made</span>"
strPosts = rsLastestPosts("Subject") & "<br>" & rsLatestPosts("tblTopic.Last_entry_date") & "<br>" & rsLatestPosts("tblAuthor.UserName")
%> <a href="forum/display_topic_threads.asp?ForumID=<% = rsLastestPosts("Forum_ID") %>&TopicID=<% = rsLastestPosts("Topic_ID") %>&PagePosition=1" target="_self" style="font-size:<% = intSmallFontSize %>" title="<% = rsLastestPosts("Subject") %><% Response.Write vbCrLf & "- Last Post On: " & rsLastestPosts("Last_entry_date") & " - " %><%
If NOT rsLastestPosts("Password") = "" Then Response.Write vbCrLf & (" - Password Required - ") ElseIf CDate(Session("dtmLastVisit")) < rsLastestPosts("Last_entry_date") AND (CBool(rsLastestPosts("Locked")) = "True") Then Response.Write vbCrLf & (" - Locked Forum - ") ElseIf CBool(rsLastestPosts("Locked")) = "True" Then Response.Write vbCrLf & (" - Closed Forum - ") ElseIf CDate(Session("dtmLastVisit")) < rsLastestPosts("Last_entry_date") Then Response.Write vbCrLf & (" - New Posts - ") Else Response.Write vbCrLf & (" - No New Posts - ") End If
%>"><% = strPosts %></a>
But it keeps throwing errors.. any ideas?
James
|