Kan DB-hentede artikler vises med nyest øverst ?
Kære alleJeg har en ASP side, som trækker nogle små artikler fra en database.
Disse artikler bliver listet på siden nedenunder hinanden !!!
MEN - Kan man ændre i koden, således at det er de nyeste artikler der står øverst, i stedet for nederst ??
Scenarie:
På "vaugrenier.com" - klik på "Nyheder" på siden til højre under NYHEDER bliver artiklerne listet, som de bliver skrevet...MEN de sidste skrevne, skulle gerne stå øverst !!
OK ? - Jeg vil med glæde uddybe, hvis jeg har skrevet lidt kryptisk ;-)
Er det nemt/svært (jeg kan ihvertfald ikke finde ud af det....)
På forhånd TUSIND TAK for hjælpen....
Her er koden:
<!-- #INCLUDE FILE="../confirm-mail/header.asp" -->
<html>
<head>
<title>Vis alle</title>
<style type="text/css">
body {COLOR: #14355E;
FONT-SIZE: 12px;
font-family: verdana,arial,sans-serif;
margin-left: 0px;
margin-top: 2px;
margin-right: 20px;
margin-bottom: 20px;
padding: 20px;
TEXT-DECORATION: none;
}
H1 {COLOR: #000000;
FONT-SIZE: 24px;
font-family: verdana,arial,sans-serif;
TEXT-DECORATION: none;
font-weight: none;
}
td
{COLOR: #14355E;
FONT-SIZE: 12px;
font-family: verdana,arial,sans-serif;
TEXT-DECORATION: none;
}
</STYLE>
<!--
<link href="../style.css" rel="STYLESHEET" TYPE="text/css">
-->
</head>
<!--
Her starter almindelig tabel med tilmelding til nyhedsbrev inden i - ikke data fra database
-->
<h1>Nyhedsbrev</h1>
<form action="../confirm-mail/mailnews.asp" METHOD="POST">
<%
'Her starter ny tabel
Response.Write "<TABLE border=0 cellPadding=0 cellSpacing=0 width='600'><TBODY><TR>"
Response.Write "<TD width=10></TD>"
Response.Write "<TD align=left vAlign=top>"
Response.Write "<TABLE border=0 cellPadding=3 cellSpacing=0 width='600'>"
Response.Write "<TBODY>"
Response.Write "<TR><TR>"
Response.Write "<TD background='billeder/sogning-left.gif' bgColor='#a6bbd6' height=25 width=4></TD>"
'Næste linie skrives overskrift
Response.Write "<TD background='billeder/sogning-right-top.gif' bgColor='#a6bbd6' height=25><b>" & "Nyhedsbrev på Dansk" & "</b></TD>"
Response.Write "<TD background='billeder/sogning-right.gif' bgColor='#a6bbd6' height=25 width=4></TD></TR>"
Response.Write "<TR><TD bgColor=#000000 colSpan=3 height=1></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='billeder/bg-boks-left.gif' width=4 bgcolor=white></TD>"
Response.Write "<TD align=left vAlign=top bgcolor=white>"
'Nedenstående linie (100%) gør at teksten fylder hele tabellen
Response.Write "<TABLE align=left border=0 cellPadding=2 cellSpacing=0 bgcolor=white width='100%'>"
Response.Write "<TBODY><TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR>"
Response.Write "<TR>"
'Næste linie skrives indhold i tabel
%>
Af sikkerhedsmæssige grunde sendes der en e-mail retur til den
indtastede e-mailadresse, som ønskes tilmeldt Nyhedstjenesten.<br>
Modtageren skal derefter bekræfte denne inden 48 timer for at blive koblet
på Nyhedsmail fra Vacances Vaugrenier.<br>
Tilmeldinger, som ikke er bekræftet inden 48 timer, bliver automatisk
slettet.
<br>
<input type="text" class="text" name="Name" size="17" value="Navn?"
onFocus="this.form.Name.select()"><br>
<input type="text" class="text" name="Emailad" size="17" value="Email?"
onFocus="this.form.Emailad.select()"><br>
<input TYPE="radio" NAME="tilmeld" Value="yes" onClick="this.form.frameld.checked=false;this.form.submit()">Tilmeld <br>
<input TYPE="radio" NAME="frameld" value="yes" onClick="this.form.tilmeld.checked=false;this.form.submit()">Frameld
</form>
<%
Response.Write "</TR>"
Response.Write "<TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD background='billeder/bg-boks-right2.gif' width=4 bgcolor=white></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='billeder/bg-boks-bottom-left.gif' height=4 width=4 bgcolor=white></TD>"
Response.Write "<TD background='billeder/bg-boks-bottom.gif' bgcolor=white></TD>"
Response.Write "<TD background='billeder/bg-boks-bottom-right2.gif' height=4 width=4 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD width=10></TD></TR></TBODY></TABLE>"
%>
</td>
</tr>
</table>
<br>
<%
'Her starter ny 2 tabel
Response.Write "<TABLE border=0 cellPadding=0 cellSpacing=0 width='600'><TBODY><TR>"
Response.Write "<TD width=10></TD>"
Response.Write "<TD align=left vAlign=top>"
Response.Write "<TABLE border=0 cellPadding=3 cellSpacing=0 width='600'>"
Response.Write "<TBODY>"
Response.Write "<TR><TR>"
Response.Write "<TD background='billeder/sogning-left.gif' bgColor='#a6bbd6' height=25 width=4></TD>"
Response.Write "<TD background='billeder/sogning-right-top.gif' bgColor='#a6bbd6' height=25><b>Nyt fra Vacances Vaugrenier</b></TD>"
Response.Write "<TD background='billeder/sogning-right.gif' bgColor='#a6bbd6' height=25 width=4></TD></TR>"
Response.Write "<TR><TD bgColor=#000000 colSpan=3 height=1></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='billeder/bg-boks-left.gif' width=4 bgcolor=white></TD>"
Response.Write "<TD align=left vAlign=top bgcolor=white>"
'Nedenstående linie (100%) gør at teksten fylder hele tabellen
Response.Write "<TABLE align=left border=0 cellPadding=2 cellSpacing=0 bgcolor=white width='100%'>"
Response.Write "<TBODY><TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR>"
Response.Write "<TR>"
sti = "../log/filupload-front-dk"
ShowSub = sti & request("ShowSub")
ShowSubLink = request("ShowSub")
strPathInfo = ShowSub
strPhysicalPath = Server.MapPath(strPathInfo)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFSO = Nothing
SiteName = request.servervariables("script_name")
strPhysicalPath = Server.MapPath(ShowSub)
If ShowSub > " " then
ShowSub = Replace(ShowSub, " ", "%20")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFolderContents = objFolder.Files
For Each objFileItem in objFolderContents
ShowPic = Replace(objFileItem.Name, " ", "%20")
Response.write "<tr><td>"
Response.Write "<span class=""link""><a href=""../log/filupload-front-dk/" & objFileItem.Name &""" target=""_blank""><img src=""../filupload/graphics/max.gif"" alt=""Åben i nyt vindue"" border=""0""></a> <a href=""../log/filupload-front-dk/" & objFileItem.Name & """ target=""_top"">" & Left(objFileItem.Name, InStrRev(objFileItem.Name, ".")-1) & "</a></span>"
Next
Set objFSO = Nothing
End if
%>
<br><br>
<strong><img src="../filupload/graphics/max.gif" width="10" height="10"><span class="style2"> = åbner filen i et nyt vindue</span></strong>
<%
Response.Write "</TR>"
Response.Write "<TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD background='billeder/bg-boks-right2.gif' width=4 bgcolor=white></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='billeder/bg-boks-bottom-left.gif' height=4 width=4 bgcolor=white></TD>"
Response.Write "<TD background='billeder/bg-boks-bottom.gif' bgcolor=white></TD>"
Response.Write "<TD background='billeder/bg-boks-bottom-right2.gif' height=4 width=4 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD width=10></TD></TR></TBODY></TABLE>"
%>
<!--
<img src="billeder/top.jpg">
-->
<h1>Nyheder</h1>
<table border="0" width="100%" cellspacing="1">
<tr><td>
<%
Dim P_kat,P_sprog,strSQL
P_kat=Request.QueryString("kat")
P_sprog=Request.QueryString("sprog")
Dim objRec, DBforbindelse, sti, ShowSub, ShowSubLink, strPathInfo, strPhysicalPath, objFSO, objFolder, SiteName, objFolderContents, objFileItem, ShowPic
Set DBforbindelse = Server.Createobject("ADODB.Connection")
DBforbindelse.Open "Driver={Microsoft Access Driver (*.MDB)}; DBQ=C:\Inetpub\wwwroot\vaugrenier\hca\db\artikellys.mdb;UID=;PWD=;"
strSQL = "SELECT * FROM artikel WHERE sprog="& P_sprog & " AND " & "kategori=" & P_kat & "ORDER BY id"
Set objRec = DBforbindelse.execute(strSQL)
Do While Not objRec.EOF
'Her starter ny tabel
'Response.Write "<center>"
Response.Write "<TABLE border=0 cellPadding=0 cellSpacing=0 width='600'><TBODY><TR>"
Response.Write "<TD width=10></TD>"
Response.Write "<TD align=left vAlign=top>"
'Response.Write "<TABLE border=0 cellPadding=3 cellSpacing=0 width=600>"
Response.Write "<TABLE border=0 cellPadding=3 cellSpacing=0 width='600'>"
Response.Write "<TBODY>"
Response.Write "<TR><TR>"
Response.Write "<TD background='billeder/sogning-left.gif' bgColor='#a6bbd6' height=25 width=4></TD>"
Response.Write "<TD background='billeder/sogning-right-top.gif' bgColor='#a6bbd6' height=25><b>" & objRec("overskrift") & "</b></TD>"
Response.Write "<TD background='billeder/sogning-right.gif' bgColor='#a6bbd6' height=25 width=4></TD></TR>"
Response.Write "<TR><TD bgColor=#000000 colSpan=3 height=1></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='billeder/bg-boks-left.gif' width=4 bgcolor=white></TD>"
Response.Write "<TD align=left vAlign=top bgcolor=white>"
'Nedenstående linie (100%) gør at teksten fylder hele tabellen
Response.Write "<TABLE align=left border=0 cellPadding=2 cellSpacing=0 bgcolor=white width='100%'>"
Response.Write "<TBODY><TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR>"
Response.Write "<TR>"
Response.Write Replace(objRec("indhold"),Vbcrlf,"<BR>")
Response.Write "</TR>"
Response.Write "<TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD background='billeder/bg-boks-right2.gif' width=4 bgcolor=white></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='billeder/bg-boks-bottom-left.gif' height=4 width=4 bgcolor=white></TD>"
Response.Write "<TD background='billeder/bg-boks-bottom.gif' bgcolor=white></TD>"
Response.Write "<TD background='billeder/bg-boks-bottom-right2.gif' height=4 width=4 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD width=10></TD></TR></TBODY></TABLE>"
'Response.Write "</center>"
objRec.MoveNext
Response.Write "<br>"
Loop
objRec.Close
Set objRec = Nothing
%>
</td>
</tr>
</table>
</html>