Help Please !!

T

Tom

I'm playing around with an events calendar I found @
http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=6976&lngWId=4

This works great apart for it only shows one event per day..

I have added more events to a day in the DB, but am struggling to get it to
display them...

everything I hvae tried has resulted in the calendar being corrupted.

if it displays the evens, I lose the dates and formatting..

I can post the code, but didn't want to create a large post !

can anyone offer a bit of advice ?

Thanks
 
E

Evertjan.

Tom wrote on 17 aug 2004 in microsoft.public.inetserver.asp.general:
I'm playing around with an events calendar I found @
http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=697
6&lngWId=4

This works great apart for it only shows one event per day..
I have added more events to a day in the DB, but am struggling to get
it to display them...
everything I hvae tried has resulted in the calendar being corrupted.
if it displays the evens, I lose the dates and formatting..
I can post the code, but didn't want to create a large post !
can anyone offer a bit of advice ?

It seems to me, Tom, that there are two ways for you to go:

1
analyze the essentials of this code and then build your own application
from scratch. This wil give you a learning curve, which steepness you van
controll. There will be help in many tutorials, in the archives of this NG,
and by asking here.

2
look for an ready application on the web that fits your requirement more or
less, without understanding the code workings, and come to live with the
deficiencies.

Asking the NG to rewrite a ready application for you does not seem an
option to me.
 
T

Tom

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 & """>&nbsp;" &
aCalendarDays((iWeek-1)*7 + iDay) & "<BR>&nbsp;&nbsp;" & FormatStr(dailyMsg)
& "</A>")
Else
Response.Write ("<TD HEIGHT=50 CLASS='calNotDay'>&nbsp;")
End IF

Response.Write "</TD>"
Next
Response.Write "</TR>"
Next

objConn.Close
set objConn = Nothing
%>
 
E

Evertjan.

Tom wrote on 17 aug 2004 in microsoft.public.inetserver.asp.general:
.......
If NOT objRS.EOF Then
dailyMsg = objRS("calendarText")
Else
dailyMsg = ""
End If
Set objRS = Nothing

dtOnDay = "2004-08-17"
strSQL = _
"SELECT * FROM calendar " &
"WHERE calendarDate = #" & dtOnDay & "#"
Set objRS = objConn.Execute(strSQL)
n=0
do until objRS.EOF
n=n+1
dayMsg(n) = objRS("calendarText")
objRS.MoveNext
loop
 
T

Tom

dtOnDay = "2004-08-17"
strSQL = _
"SELECT * FROM calendar " &
"WHERE calendarDate = #" & dtOnDay & "#"
Set objRS = objConn.Execute(strSQL)
n=0
do until objRS.EOF
n=n+1
dayMsg(n) = objRS("calendarText")
objRS.MoveNext
loop

This seems to error !

the line dayMsg(n) seems to be the problem.

if I remove (n) I get the calendar displayed correctly, but the dates are
all filled in with the last entry...
 
E

Evertjan.

Tom wrote on 17 aug 2004 in microsoft.public.inetserver.asp.general:
This seems to error !

the line dayMsg(n) seems to be the problem.

if I remove (n) I get the calendar displayed correctly,
but the dates are
all filled in with the last entry...

You will need to dim the array beforehand,

dim dayMsg(20)

I thought you would know that, just as I thought
you would know how to display the same array.

This is why I suggested in this thread, that,
if you do not understand the code,
you should only use a finished product.
 
T

Tom

You will need to dim the array beforehand,

dim dayMsg(20)

I thought you would know that, just as I thought
you would know how to display the same array.

This is why I suggested in this thread, that,
if you do not understand the code,
you should only use a finished product.

Thanks for your help.
I'm (very) new to ASP, but am willing to learn.

The need for this calendar is to keep track of the meetings/ clubs etc for
my kids...

the 3 of them have more things going on than the rest of my family. :)

I have got it working using :

<font size="2"><b><A href="<%=strpage%>"><%=aCalendarDays((iWeek-1)*7 +
iDay)%></a></font></b><br>
<%
' Checks for a message on the day being written
strSQL = _

"SELECT * FROM calendar " &_
"WHERE calendardate = #" & dtOnDay & "#"
Set objRS = objConn.Execute(strSQL)
do until objRS.EOF
dailyMsg= objRS("calendarText")
kidsname= objRS("kidsname")
event= objRS("event")


Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top