It seems to me, Tom, that there are two ways for you to go:
Hi,
I wasn't asking for someone to write all the code for me...
I can see where I think the problem is, I was after some advise on how to
resolve it.
I have posted the relevant bit below.
If I edit this section:
' Checks for a message on the day being written
strSQL = "SELECT * FROM calendar WHERE calendarDate = #" & dtOnDay & "#"
Set objRS = objConn.Execute(strSQL)
If NOT objRS.EOF Then
dailyMsg = objRS("calendarText")
Else
dailyMsg = ""
End If
Set objRS = Nothing
I screws the whole thing up... Could some please explain and point me in the
right direction, how I can get this to loop through the database, inserting
multiple records into a day..
<%
Set objConn = Server.CreateObject("ADODB.Connection")
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" &
Server.MapPath("db.mdb") & ";Persist Security Info=False;"
objConn.Open(strConn)
For iWeek = 1 To iRows
Response.Write "<TR VALIGN=TOP>"
For iDay = 1 To iColumns
' Checks to see if there is a day this month on the date being written
If aCalendarDays((iWeek-1)*7 + iDay) > 0 then
dtOnDay = DateSerial(Year(dtCurrentDate), Month(dtCurrentDate),
aCalendarDays((iWeek-1)*7 + iDay))
' Checks to see if the day being printed is today
If dtOnDay = dtToday Then
Response.Write "<TD HEIGHT=55 CLASS='calCurrentDay'>"
Else
Response.Write "<TD HEIGHT=55 CLASS='calOtherDay'>"
End If
' Checks to see the type of calendar (editable or non-editable)
If (bolEditable) then
strPage = "updateCalendar_form.asp?currentDate=" & dtOnDay
Else
strPage = "viewDay.asp?currentDate=" & dtOnDay
End If
' Checks for a message on the day being written
strSQL = "SELECT * FROM calendar WHERE calendarDate = #" & dtOnDay & "#"
Set objRS = objConn.Execute(strSQL)
If NOT objRS.EOF Then
dailyMsg = objRS("calendarText")
Else
dailyMsg = ""
End If
Set objRS = Nothing
' Checks to see if the message is too long to be displayed in the mini
date box
If (Trim(dailyMsg) = Trim(Left(dailyMsg, intCharToShow))) Then
Else
dailyMsg = Trim(Left(dailyMsg, intCharToShow-4)) & " ..."
End If
Response.Write ("<A HREF=""" & strPage & """> " &
aCalendarDays((iWeek-1)*7 + iDay) & "<BR> " & FormatStr(dailyMsg)
& "</A>")
Else
Response.Write ("<TD HEIGHT=50 CLASS='calNotDay'> ")
End IF
Response.Write "</TD>"
Next
Response.Write "</TR>"
Next
objConn.Close
set objConn = Nothing
%>