Professional Web Applications Themes

Help Please !! - ASP Database

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...

  1. #1

    Default Help Please !!

    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






    Tom Guest

  2. #2

    Default Re: Help Please !!

    Tom wrote on 17 aug 2004 in microsoft.public.inetserver.asp.general: 

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

    1
    yze 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.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

  3. #3

    Default Re: Help Please !!

    Here ya go
    http://www.darkfalz.com/1050


    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Tom" <co.uk> wrote in message
    news:41214189$0$8516$dial.pipex.com... 


    Curt_C Guest

  4. #4

    Default Re: Help Please !!


    "Evertjan." <net> wrote in message
    news:109.133.29...
     
    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 s 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
    %>


    Tom Guest

  5. #5

    Default Re: Help Please !!


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:phx.gbl... 
    Thanks, I will take a look, but I would prefer to understand how to get the
    other one working..


    Tom Guest

  6. #6

    Default Re: Help Please !!

    Tom wrote on 17 aug 2004 in microsoft.public.inetserver.asp.general: 

    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


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

  7. #7

    Default Re: Help Please !!

    On 17 Aug 2004 16:51:59 GMT, Evertjan. wrote:

     

    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...
    Tom Guest

  8. #8

    Default Re: Help Please !!

    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...
    >[/ref]

    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.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

  9. #9

    Default Re: Help Please !!

    On 17 Aug 2004 17:33:44 GMT, Evertjan. wrote:
     

    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
    Tom Guest

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139