<%
' Cycle through the news table and grab all entries
' then present them.
' Open the database
OpenDB Con
Dim SQL, RS
SQL = "SELECT * FROM SamHouseNews ORDER BY DateCreated DESC;"
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.ActiveConnection = Con
RS.CursorType = adOpenStatic
RS.CursorLocation = adUSEClient
RS.Open(SQL)
IF NOT RS.EOF Then
While Not RS.EOF
' Destination of href
IF RS.Fields("PageHTML").Value <> "" AND RS.Fields("PageHTML") <> "0" Then
PageHTML = "news/" & RS.Fields("PageHTML").Value
Else
PageHTML = "images/news/" & RS.Fields("IDNumber").Value & ".htm"
End IF
Response.Write("" & RS.Fields("Title").Value & " ")
Response.Write("" & RS.Fields("Teaser").Value & "
")
RS.MoveNext
Wend
End IF
RS.Close:Set RS = Nothing
Con.Close:Set Con = Nothing
%>