Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Greetings All,

 

I have the following ASP code generated by MS Access, the code displays a table that can be viewed via a web browser. Currently the code displays the first record first and the last record last, is there a way to switch it so that it displays the last record first and the first record last?

 

Here's the code:

 

 

<HTML>

<HEAD>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1252">

<TITLE>PHSWEB</TITLE>

</HEAD>

<BODY>

<%

If IsObject(Session("PHSWEB_conn")) Then

Set conn = Session("PHSWEB_conn")

Else

Set conn = Server.CreateObject("ADODB.Connection")

conn.open "PHSWEB","",""

Set Session("PHSWEB_conn") = conn

End If

%>

<%

If IsObject(Session("Messages_rs")) Then

Set rs = Session("Messages_rs")

Else

sql = "SELECT * FROM [Messages]"

Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open sql, conn, 3, 3

If rs.eof Then

rs.AddNew

End If

Set Session("Messages_rs") = rs

End If

%>

 

<%

 

On Error Resume Next

rs.Movefirst

do while Not rs.eof

%>

 

 

<TABLE WIDTH=400 BORDER=1 BORDERCOLOR=BLACK CELLPADDING=3 CELLSPACING=0>

<TD BGCOLOR=#CCCCCC><FONT FACE=ARIAL SIZE=1>Posted by <%=Server.HTMLEncode(rs.Fields("Posted By").Value)%> at <%=Server.HTMLEncode(rs.Fields("Time of Post").Value)%></TD>

<TR>

<TD><FONT FACE=ARIAL SIZE=2><%=Server.HTMLEncode(rs.Fields("Message").Value)%><BR></FONT></TD>

</TABLE>

<BR>

 

 

 

<%

rs.Movenext

loop%>

 

</BODY>

</HTML> <HTML>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...