I am modifying an Events Calendar for a website. Unfortunately, I am an ASP novice. Below is the code for the Calendar Admin function, but it is only displaying events for the current day. I'd like it to pull ALL events from the Access DB. Any ideas?
Thanks so much, Rick
----------------------------------------------------------
<!--#include file="config.asp" -->
<%
if not Session("DiaryAdmin") then
Response.Redirect("login.asp?go=diary_manager.asp?" & Request.QueryString())
End If
function dNum
if n >= 10 then
dNum = cstr
Else
dNum = "0" & cstr
End If
End Function
'SQL Formatted Date
Function SQLDate(dt)
SQLDate = cdbl(dt)
End Function
Response.ExpiresAbsolute = dateadd("d", -5, date())
Response.Expires = -10
set objCon= Server.CreateObject("ADODB.Connection")
set objRs = Server.CreateObject("ADODB.Recordset")
objCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\websites\
view_date = Request.QueryString("view_date")
if view_date = "" then view_date = clng(date())
%>
<HTML>
<HEAD>
<meta name=vs_targetSchema content="<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<META NAME="ROBOTS" CONTENT="INDEX,NOFOLLOW">
<script language="javascript">
function openWin(win, w, h) {
var le = (screen.availWidth - w) /2;
var he = (screen.availHeight -h) /2;
window.open(win,null,"height="+h+",width="+w+",status=no,toolbar=no,scrollbars=no,menubar=no,location=no,left="+le+", top="+he,false);
//location.reload();
}
</script>
<title>Diary Manager</title>
<link rel="stylesheet" type="text/css" href="diary.css">
</head>
<body>
<%
SQL = "SELECT id , dte, diary.text_field, Diary_Categorys.Category, Diary_Categorys.Colour, Diary_Categorys.BgColour" & _
" FROM Diary_Categorys RIGHT JOIN diary ON Diary_Categorys.Cat_ID = diary.Category where dte = " & view_date
objRs.Open SQL, objCon
%>
<div class="Heading2">Calendar Manager</div>
<div align="right"><a href="javascriptpenWin('diary_EditE.asp?mode=Add&view_date=<%=SQLDate(view_date)%>&cat=all', 400, 400)">Add New Event</a> | <a href="diary_category.asp">Edit Categories</a> | <a href="default.asp?view_Date=<%=Request.QueryString("View_Date")%>">Back</a></div>
<div class=heading3><%= day(view_date) & " " & monthname(month(view_date)) & " " & year(view_date) %></div>
<table border="0" cellpadding="4" cellspacing="3" align=center>
<tr valign="top">
<td class="heading3">Choose an Event to Edit</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="1" class="maintble" width="350">
<tr>
<td class=titlebar>Event</td>
<td class=titlebar>Date & Time</td>
</tr>
<%
if objRs.EOF or objRs.BOF then
Response.Write "<tr><td colspan=2 class=Item>No events found for today</td></tr></table>"
Else
do until objRs.EOF
d = cdate(objRs("dte"))
Response.Write "<tr>"
Response.Write "<td class=item><a href=""javascriptpenWin('diary_EditE.asp?view_date=" & view_date & "&mode=edit&id=" & objRs("id") & "', 400, 400)"">" & objRs("text_field") & "</a></td>"
Response.Write "<td class=Item>" & day(d) & " " & monthname(month(d)) & " " & year(d) & "</td>" & vbcrlf
Response.Write "</tr>"
objRs.MoveNext
loop
Response.Write "</table>"
End If
%>
</td>
</tr>
</table>
<!-- This footer is required by the license terms, removing it is illegal! --><br />
<div align="center" class="normal"></div>
</BODY>
</HTML>
<%
on error resume next
objRs.Close
objCon.Close
set objRs= nothing
set objCon = nothing
%>
Thanks so much, Rick
----------------------------------------------------------
<!--#include file="config.asp" -->
<%
if not Session("DiaryAdmin") then
Response.Redirect("login.asp?go=diary_manager.asp?" & Request.QueryString())
End If
function dNum
if n >= 10 then
dNum = cstr
Else
dNum = "0" & cstr
End If
End Function
'SQL Formatted Date
Function SQLDate(dt)
SQLDate = cdbl(dt)
End Function
Response.ExpiresAbsolute = dateadd("d", -5, date())
Response.Expires = -10
set objCon= Server.CreateObject("ADODB.Connection")
set objRs = Server.CreateObject("ADODB.Recordset")
objCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\websites\
view_date = Request.QueryString("view_date")
if view_date = "" then view_date = clng(date())
%>
<HTML>
<HEAD>
<meta name=vs_targetSchema content="<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<META NAME="ROBOTS" CONTENT="INDEX,NOFOLLOW">
<script language="javascript">
function openWin(win, w, h) {
var le = (screen.availWidth - w) /2;
var he = (screen.availHeight -h) /2;
window.open(win,null,"height="+h+",width="+w+",status=no,toolbar=no,scrollbars=no,menubar=no,location=no,left="+le+", top="+he,false);
//location.reload();
}
</script>
<title>Diary Manager</title>
<link rel="stylesheet" type="text/css" href="diary.css">
</head>
<body>
<%
SQL = "SELECT id , dte, diary.text_field, Diary_Categorys.Category, Diary_Categorys.Colour, Diary_Categorys.BgColour" & _
" FROM Diary_Categorys RIGHT JOIN diary ON Diary_Categorys.Cat_ID = diary.Category where dte = " & view_date
objRs.Open SQL, objCon
%>
<div class="Heading2">Calendar Manager</div>
<div align="right"><a href="javascriptpenWin('diary_EditE.asp?mode=Add&view_date=<%=SQLDate(view_date)%>&cat=all', 400, 400)">Add New Event</a> | <a href="diary_category.asp">Edit Categories</a> | <a href="default.asp?view_Date=<%=Request.QueryString("View_Date")%>">Back</a></div>
<div class=heading3><%= day(view_date) & " " & monthname(month(view_date)) & " " & year(view_date) %></div>
<table border="0" cellpadding="4" cellspacing="3" align=center>
<tr valign="top">
<td class="heading3">Choose an Event to Edit</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="1" class="maintble" width="350">
<tr>
<td class=titlebar>Event</td>
<td class=titlebar>Date & Time</td>
</tr>
<%
if objRs.EOF or objRs.BOF then
Response.Write "<tr><td colspan=2 class=Item>No events found for today</td></tr></table>"
Else
do until objRs.EOF
d = cdate(objRs("dte"))
Response.Write "<tr>"
Response.Write "<td class=item><a href=""javascriptpenWin('diary_EditE.asp?view_date=" & view_date & "&mode=edit&id=" & objRs("id") & "', 400, 400)"">" & objRs("text_field") & "</a></td>"
Response.Write "<td class=Item>" & day(d) & " " & monthname(month(d)) & " " & year(d) & "</td>" & vbcrlf
Response.Write "</tr>"
objRs.MoveNext
loop
Response.Write "</table>"
End If
%>
</td>
</tr>
</table>
<!-- This footer is required by the license terms, removing it is illegal! --><br />
<div align="center" class="normal"></div>
</BODY>
</HTML>
<%
on error resume next
objRs.Close
objCon.Close
set objRs= nothing
set objCon = nothing
%>