udtræk af nyheder via dato information
jeg har fundet et godt kalender script og fået det tilpasset og det virker og det hele, men nu vil jeg lave en ekstra funktion hvor man vælger i en drop down menu fra år/måned/dag, til år/måned/dag og med en submit knap som får explorer feltet til at vise:http://*.*.*.*/kalender2/udtraek.asp?ar=2006&man=01&dag=18&ar=2006&man=01&dag=21&ar=Send
har valgt fra 18.01.06 til 21.01.06 så det virker jo :)
her er min kode :
<%Response.Buffer = True
Session.Lcid = 1053
datum = Date()
nu = Date()
ar = DatePart("yyyy", nu, 2, 0)
manad = DatePart("m", nu, 2, 0)
dag = DatePart("d", nu, 2, 0)
sd = DateSerial(ar, manad, 1)
sn = DatePart("w", sd, 2, 0)%>
<!--#Include file="manader.asp"-->
<!--#Include file="settings.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>manuelt udtræk</title>
<script src="js/js.js"></script>
</head>
<body onLoad="<%=mess%>">
<p>
<%Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & db
If Request.Querystring("do")="" Then
SET RS = Conn.Execute("Select * From Mess Where manad= " & manad & "")%>
<b>Dato fra:</b>
<form name="input" action="udtraek.asp" method="get">
<select name="ar" style="width:55">
<option value="">År
<%Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "Select ar From ar Order By id"
RS.Open SQL, Conn
Do Until RS.EOF
Response.Write Space(10) & "<option value=" & chr(34) & RS("ar") & chr(34)
If Int(Year(Date)) = Int(RS("ar")) Then Response.Write " selected"
Response.Write ">" & RS("ar") & vbCrLf
RS.MoveNext
Loop
RS.Close
Set RS = Nothing%>
</select>
<select name="man" style="width:40">
<option value="">Måned
<%Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "Select man From man order by id"
RS.Open SQL, Conn
Do Until RS.EOF
Response.Write Space(10) & "<option value=" & chr(34) & RS("man") & chr(34)
If Int(Month(Date)) = Int(RS("man")) Then Response.Write " selected"
Response.Write ">" & RS("man") & vbCrLf
RS.MoveNext
Loop
RS.Close
Set RS = Nothing%>
</select>
<select name="dag" style="width:40">
<option value="">Dag
<%Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "Select dag From dag Order By id"
RS.Open SQL, Conn
Do Until RS.EOF
Response.Write Space(10) & "<option value=" & chr(34) & RS("dag") & chr(34)
If Int(Day(Date)) = Int(RS("dag")) Then Response.Write " selected"
Response.Write ">" & RS("dag") & vbCrLf
RS.MoveNext
Loop
RS.Close
Set RS = Nothing%>
</select>
<br /><br />
<b>Dato til:</b><br />
<form name="input" action="udtraek.asp" method="get">
<select name="ar" style="width:55">
<option value="">År
<%Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "Select ar From ar Order By id"
RS.Open SQL, Conn
Do Until RS.EOF
Response.Write Space(10) & "<option value=" & chr(34) & RS("ar") & chr(34)
If Int(Year(Date)) = Int(RS("ar")) Then Response.Write " selected"
Response.Write ">" & RS("ar") & vbCrLf
RS.MoveNext
Loop
RS.Close
Set RS = Nothing%>
</select>
<select name="man" style="width:40">
<option value="">Måned
<%Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "Select man From man order by id"
RS.Open SQL, Conn
Do Until RS.EOF
Response.Write Space(10) & "<option value=" & chr(34) & RS("man") & chr(34)
If Int(Month(Date)) = Int(RS("man")) Then Response.Write " selected"
Response.Write ">" & RS("man") & vbCrLf
RS.MoveNext
Loop
RS.Close
Set RS = Nothing%>
</select>
<select name="dag" style="width:40">
<option value="">Dag
<%Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "Select dag From dag Order By id"
RS.Open SQL, Conn
Do Until RS.EOF
Response.Write Space(10) & "<option value=" & chr(34) & RS("dag") & chr(34)
If Int(Day(Date)) = Int(RS("dag")) Then Response.Write " selected"
Response.Write ">" & RS("dag") & vbCrLf
RS.MoveNext
Loop
RS.Close
Set RS = Nothing%>
</select>
<br /><br />
<input type="Submit" name="ar" value="Send">
<%End If%>
</p>
</body>
</html>
--------------------
spørgsmålet er nu hvordan jeg får lavet det så databasen (som er access) smider de nyheder som ligger imellem den fra og til dato som jeg har fået lavet.