Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Problem creating a birthday list

Problem creating a birthday list

Scheduled Pinned Locked Moved Web Development
helpcsharpasp-netdatabase
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    matjame
    wrote on last edited by
    #1

    Hello guys, Ive been hustling to create a birthday list through my asp, and :rolleyes: MS Access database..I cant seem to get anywhere. I have done this in ASP.NET(aspx, my programming language) and it worked fine.So each day the code will check using the system date compared with the dates in the database who is celebrating their birthdays and then print the details. If no-one celebrates on that day, then I need a message that points that out. Please guys, help out here.I need help.I have been doing research online and Im not getting anywhere. Thanx in advance

    kagiso

    P 1 Reply Last reply
    0
    • M matjame

      Hello guys, Ive been hustling to create a birthday list through my asp, and :rolleyes: MS Access database..I cant seem to get anywhere. I have done this in ASP.NET(aspx, my programming language) and it worked fine.So each day the code will check using the system date compared with the dates in the database who is celebrating their birthdays and then print the details. If no-one celebrates on that day, then I need a message that points that out. Please guys, help out here.I need help.I have been doing research online and Im not getting anywhere. Thanx in advance

      kagiso

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      Do you have a specific problem?

      M 1 Reply Last reply
      0
      • P Paddy Boyd

        Do you have a specific problem?

        M Offline
        M Offline
        matjame
        wrote on last edited by
        #3

        Yes, my problem is, Ive created a birthday list in ASP.NET but I Cant seem to find a way in ASP. So I need help with that.I need to first check if the database date and the system date are the same then print the details of people from the database who celebrates at that day. ]]> ") end if rs.close set rs = nothing end if %>]]>

        kagiso

        K G 2 Replies Last reply
        0
        • M matjame

          Yes, my problem is, Ive created a birthday list in ASP.NET but I Cant seem to find a way in ASP. So I need help with that.I need to first check if the database date and the system date are the same then print the details of people from the database who celebrates at that day. ]]> ") end if rs.close set rs = nothing end if %>]]>

          kagiso

          K Offline
          K Offline
          keyboard warrior
          wrote on last edited by
          #4

          Is there only one birthday possible? Also, Do you really need to get the BDate from the database? If it really is only the day of. Looks like you should be looping through the rs

          ----------------------------------------------------------- Completion Deadline: two days before the day after tomorrow

          M 1 Reply Last reply
          0
          • M matjame

            Yes, my problem is, Ive created a birthday list in ASP.NET but I Cant seem to find a way in ASP. So I need help with that.I need to first check if the database date and the system date are the same then print the details of people from the database who celebrates at that day. ]]> ") end if rs.close set rs = nothing end if %>]]>

            kagiso

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            Removing some crap, adding some looping and some crucial closing of the recordset, it became this:

            <%@ LANGUAGE="VBSCRIPT" %>
            <%
            Option Explicit
            %>
            <!--#include file="includes/main_page_header.asp"-->
            <%
            Dim BDate, sql, EmployeeName
            'load in record
            BDate = Request.QueryString("BDate")
            If IsEmpty(BDate) Then
            Response.Redirect gsSiteRoot & "Birthdays/"
            Else
            sql = sql_GetBirthdays(BDate)
            Call runSQL(sql, rs)
            If rs.EOF Then
            ' It's important that you close the recordset before redirecting
            rs.Close()
            Set rs = Nothing
            ' Also, you need to close the database connection here!
            Response.Redirect gsSiteRoot & "Birthdays/"
            Else
            While Not rs.EOF
            EmployeeName = rs("EmployeeName")
            BDate = rs("BDate")
            Department = Replace(rs("Department"),vbCrLf,"<br/>")
            ' Here you should output the information to the page
            rs.MoveNext()
            Wend
            End If
            rs.Close()
            Set rs = Nothing
            ' Here you also need to close the database connection!
            End If
            %>

            Note the comments about the database connection. It's crucial that you always close the database connection, otherwise the database will stop working after a while.

            Experience is the sum of all the mistakes you have done.

            1 Reply Last reply
            0
            • K keyboard warrior

              Is there only one birthday possible? Also, Do you really need to get the BDate from the database? If it really is only the day of. Looks like you should be looping through the rs

              ----------------------------------------------------------- Completion Deadline: two days before the day after tomorrow

              M Offline
              M Offline
              matjame
              wrote on last edited by
              #6

              Its possible that we may have one or no birthdays for the day.YES. And yes I need to get the birthdays from BDATE in the database because its a lot of people in the company and I dont want to have them struggle with modifying the page when Im gone for its only I that is responsible for the intranet site. ") end if rs.close set rs = nothing end if %>]]> :((

              kagiso

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups