% Option Explicit %>
<%
Dim rsNews 'Database recordset holding the news items
Dim rsComments 'Database recordset holding the comments for this news item
Dim lngNewsID 'Holds the News item ID number
'Read in the ID number of the news item we are looking at the comments of
If isNull(Request.QueryString("NewsID")) = True Or isNumeric(Request.QueryString("NewsID")) = False Then
Response.Write "default.asp"
Else
lngNewsID = CLng(Request.QueryString("NewsID"))
End If
%>
News Comments
Your comments & suggestions
<%
'Create recorset object
Set rsNews = Server.CreateObject("ADODB.Recordset")
'Initalise the strSQL variable with an SQL statement to query the database by selecting all tables ordered by the decending date
strSQL = "SELECT tblNews.* FROM tblNews "
strSQL = strSQL & "WHERE tblNews.News_ID = " & lngNewsID
strSQL = strSQL & " ORDER BY Date_stamp DESC;"
'Query the database
rsNews.Open strSQL, adoCon
'If there are no records then exit for loop
If NOT rsNews.EOF Then
%>
<%
End If
%>