Forum Moderators: open
I am looking to display the date the page was last updated. The only catch is that it can't be server based, but I need to read the 'date' field of the last entry of a record set and display it.
I am working on making this a dynamic page, so not all the records are in yet.
I want to be able to look at the latest post and pull the "date" field from it and display it on top.
Here is the code for the page... hopefully this helps. Please let me know if there is a way I can do this. Thanks!
----------------------------------- SOURCE CODE -------------------
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/main.asp" -->
<%
Dim rs_enhance
Dim rs_enhance_cmd
Dim rs_enhance_numRows
Set rs_enhance_cmd = Server.CreateObject ("ADODB.Command")
rs_enhance_cmd.ActiveConnection = MM_main_STRING
rs_enhance_cmd.CommandText = "SELECT * FROM Enhancements ORDER BY [date] DESC"
rs_enhance_cmd.Prepared = true
Set rs_enhance = rs_enhance_cmd.Execute
rs_enhance_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rs_enhance_numRows = rs_enhance_numRows + Repeat1__numRows
%>
<DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Stratus - Enhancements</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="main.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY>
<%
strOddColor = "bgcolor='#CCCCCC'"
strEvenColor = "bgcolor='#FFFFFF'"
intLineNum = 0
%>
<table width=750 border=0>
<tr>
<td valign="top">
<table width=100% border=0>
<tr>
<td><font size="3" face="Arial, Helvetica, sans-serif"><IMG width="180" height="75" src="graphics/image002.jpg"></font></td>
<td><div align="center"><span class="BodyTitle">Enhancements
Archives</span><br>
<span class="DateTitle">(Revised 3/27/08)</span></div></td>
<td><div align="right"><font size="3" face="Arial, Helvetica, sans-serif"><img width="151" height="75" src="graphics/mlsps_sm.gif"></font></div></td>
</tr>
<tr valign="top">
<td colspan=3><div align="center" class="DateTitle">
<p>In case you missed them appearing on Stratus News, below are previous updates to Stratus MLS & the consumer site, mlsli.com, listed in chronological order of their release date.</p>
</div></td>
</tr>
</table>
<p> </p>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs_enhance.EOF))
%>
<table width=100% height="0" border=1 cellpadding="3" cellspacing="0" bordercolor="#000000">
<tr>
<%
intLineNum = intLineNum + 1
If intLineNum Mod 2 = 0 Then
strLineColor = strEvenColor
Else
strLineColor = strOddColor
End If
%>
<td valign="top" <%=strLineColor%>><p><span class="DateTitle"><%=(rs_enhance.Fields.Item("date").Value)%> - <%=(rs_enhance.Fields.Item("title").Value)%> </span><br>
<br>
<span class="Body"><%=(rs_enhance.Fields.Item("body").Value)%></span>
</p> </td>
</tr>
</table><p> </p>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_enhance.MoveNext()
Wend
%>
<p></td>
</tr>
</table><p>
</BODY>
</HTML>
<%
rs_enhance.Close()
Set rs_enhance = Nothing
%>
[edited by: engine at 4:46 pm (utc) on April 7, 2008]
[edit reason] See TOS [/edit]