Tagwall LOOP
Hey jeg har en tagwall på min hp www.rasmuslarsen.com/Tagwall/tagwall.asp jeg har bare det problem at de ældste beskeder ligger øverst og de nyeste nederst jeg skal bruge det omvendt her er koden:<% response.buffer = true %>
<html>
<head>
<title>rL - Tagwall</title>
<style>
BODY {
SCROLLBAR-FACE-COLOR: #FF9900;
SCROLLBAR-SHADOW-COLOR: #3399FF;
SCROLLBAR-ARROW-COLOR: #3399FF;
}
</style>
<style>
A:link {
COLOR: black;
TEXT-DECORATION: none;
} A:visited {
COLOR: black;
TEXT-DECORATION: none;
} A:active {
COLOR: black;
TEXT-DECORATION: none;
cursor: hand;
} A:hover {
COLOR: #3399FF;
TEXT-DECORATION: none;
cursor: hand;
}
</style>
<style fprolloverstyle>A:hover {color: #3399FF; font-family: Verdana; font-size: 10 px; text-decoration: none}
</style>
</head>
<body bgcolor="#C0C0C0" background="bg3.jpg">
<p align="center"><% if Request.QueryString("mode")="" then %></p>
<div align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%">
<p align="center"><font color="black" face="Verdana" size="1"><a href="tagwall.asp?mode=add"><b>Tilføj Besked</b></a></font><font size="1"><font face="Arial Black"><br>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("Tagwall.mdb")
strSQL = "Select * From Tagwall"
set rs = Conn.execute(strSQL)
if rs.EOF then
Response.write "<font face=""Verdana"" size=""1""><i>Ingen Tags... endnu... ellers er de alle slettet.</i></font>"
else
Do Until rs.EOF%>
</font></font><font
size="1" face="Verdana">
<br>
</font></p>
</td>
</tr>
</table>
</center></div><div align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" align="center"><font color="black"><font face="Verdana" size="1">Den <%=RS("Dato")%>
skrev: <%=RS("forfatter")%></font><font face="Verdana" size="1"><br>
</font>
<font size="1" face="Verdana"><b><%=RS("tekst")%></b></a></font></font></td>
</tr>
</table>
</center></div>
<hr width="100%" color="Darkblue">
<p><%RS.MoveNext
Loop
end if
Conn.Close
Set Conn = Nothing%></p>
<p><% elseif Request.QueryString("mode")="add" then %></p>
<p align="center"><font face="Verdana" color="black" size="1">Indlæg:</font></p>
<form action="tagwall.asp?mode=save" method="POST">
<div align="center"><center><table border="0" cellpadding="2"
cellspacing="0" width="50%">
<tr>
<td align="right" width="20%"><font face="Verdana" color="black" size="1">Navn:</font></td>
<td colspan="2" width="80%"><font size="1"
face="Verdana"><input style="BACKGROUND-COLOR: #FF9900" type="text" size="30"
name="Forfatter"></font></td>
</tr>
<tr>
<td align="right" valign="top" width="20%"><font face="Verdana" color="black" size="1">Tekst:</font></td>
<td valign="top" width="10%"><font size="2"
face="Verdana"><textarea style="BACKGROUND-COLOR: #FF9900" name="Tekst" rows="4"
cols="30"></textarea></font></td>
<td valign="top" width="90%"><font size="1"
face="Verdana"></font></td>
</tr>
</table>
</center></div><p align="center"><input style="BACKGROUND-COLOR: #FF9900" type="submit"
name="B1" value="Add"></p>
</form>
<p><% elseif Request.QueryString("mode")="save" then %> <%
response.buffer = true
Const adOpenKeyset = 1
Const adLockOptimistic = 3
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("Tagwall.mdb") & ";UID=admin;PWD=;"
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "Select * From Tagwall"
rs.Open strSQL, Conn, adOpenKeyset, adLockOptimistic
rs.AddNew
rs("Forfatter") = Request.form("Forfatter")
rs("Tekst") = Request.form("Tekst")
rs("Dato") = date()
rs.Update
rs.Close
Set rs = Nothing
Conn.Close
set Conn = Nothing
response.redirect "tagwall.asp"
%><%end if%></p>
</body>
</html>