Problem creating a birthday list
-
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
-
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
Do you have a specific problem?
-
Do you have a specific problem?
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
-
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
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
-
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
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.
-
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
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