Udløbsdato for info fra DB
Hvis man nu ønsker, at der skal være en udløbsdato for hilsnerne i ens gæstebog fra en DB, hvordan gør man så det i nedenstående fil?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Systematics homekitchen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<link href="ego.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
@import url("systematic.css");
-->
</style>
<style>
BODY { SCROLLBAR-FACE-COLOR: #ffffff;
SCROLLBAR-HIGHLIGHT-COLOR: #ff0000;
SCROLLBAR-SHADOW-COLOR: #cccccc;
SCROLLBAR-3DLIGHT-COLOR: #DFDFDF;
SCROLLBAR-ARROW-COLOR: #ff0000;
SCROLLBAR-TRACK-COLOR: #ffffff;
SCROLLBAR-DARKSHADOW-COLOR: #ffffff
}
</style>
</head>
<body class="broedtxt">
<table width="680" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60"><img src="grafik/trans.gif" width="80" height="30" border="0"></td>
<td width="620"></td>
</tr>
<tr>
<td></td>
<td valign="top" class="overskrifter"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="grafik/overskrifter/risogros.gif" width="240" height="24"></td>
</tr>
<tr>
<td><img src="grafik/trans.gif" width="6" height="15"></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
<td valign="top" class="broedtxt"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<%
' Databaseforbindelse - husk at angive sti til din database
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("../Systematic/users.mdb")
Conn.Open DSN
' SQL forespørgsel
strSQL = "Select * from risogros order by ID desc"
' Udfør forespørgsel (objRec indeholder nu resultatet)
Set objRec = Conn.Execute(strSQL)
do while not objRec.eof
comment = Replace(objrec("text"), vbCrLf, "<BR>")
response.write "<table border=""1"" bordercolor=""#cccccc"" width=""550"" cellpadding=""20"" cellspacing=""3""><tr><td bordercolor=""#cccccc"">"
response.write "<table width=""550"" align=""center"" cellpadding=""3"" cellspacing=""0""><tr class=""broedtxt""><td background=""system/td_back.gif"">"
response.write "<span class=""overskrifter"">" & objrec("nick") & "</span>"
response.write "</td><td align=""right"" background=""system/td_back.gif"">"
response.write "<a href=mailto:" & objrec("email") & " onFocus=""this.blur()""><img src=grafik/envelope.gif border=0 alt=" & objrec("email") & "></a>"
response.write "</td></tr>"
response.write "<tr><td colspan=""2"">"
response.write "<table class=""broedtxt"" cellpadding=""0"" cellspacing=""0"" width=""100%""><tr><td>"
response.write comment
response.write "</td></tr></table>"
response.write "</td></tr>"
response.write "<tr class=""datotidDB""><td background=""system/td_back2.gif"">"
response.write "date: " & objrec("dato")
response.write "</td><td align=""right"" background=""system/td_back2.gif"">"
response.write "time: " & objrec("tid")
response.write "</td></tr></table>"
response.write "</td></tr></table><br>"
objRec.movenext
loop
' Luk databaseforbindelse
Conn.Close
Set Conn = Nothing
%>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
Jeg håber, det er den rigtige fil, jeg har tilføjet?
//D