By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,399 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,399 IT Pros & Developers. It's quick & easy.

Asp and access database--Long

P: n/a
I have an Access database that I have web enabled using ASP, everything
works fine except for one thing. Let me start by giving a background of
the requirements.
This is an online obituary database for a funeral home, I have 4 ASP
pages; obits.asp (displays records from a table in the DB),
DBInputFormc.ASP (used to input condolences into another table same
db), Condolences.ASP (Displays records from the condolences table in
the DB), and Thankyou.ASP (posts data from the DBInputFormc.asp page to
the condolences table in the DB).
My problem is, I want to be able for the visitors to be able to click
on the deceased name on the obits.asp page and open the
DBInputformc.asp page to leave thier condolences without having to
enter the deceased name on the form. ( i.e. want to pass the deceased
name from obits.asp to DBInputFormc.asp then post it to the db. Also
they should be able to view the condolences for the deceased by
clicking on their name from the obits.asp page. Below is the code for
each page, the live site can be viewed at www.davisfuneral-chapel.com,
any assistance would be appreciated.
(Obits.ASP)
<% Response.Buffer = True %>
<html>
<head>
<title>Davis Funeral Chapel Obituaries</title>
</head>
<body>
<BODY BGCOLOR="white" bgproperties="fixed">
<FONT FACE="Verdana" SIZE=4 COLOR="green">Obituaries</font>
<center>Click <a href="condolences.asp">here</a> to view the guestbook
for all condolences.</center>
<hr color="B54039">
<FONT FACE="Verdana" SIZE="2">
<%
Dim rs
Set rs = Server.CreateObject ("ADODB.Recordset")

rs.Open "deceased", "DSN=condolences.dsn"

While Not rs.EOF
Response.Write "Name: " & rs("firstname") & " " &
rs("lastname") & " " & "<a href=DBInputFormc.asp>Send Condolences</a>"
& "<br>"
Response.Write "Date of Birth: " & rs("DOB") & "<br>"
Response.Write "Date of Death: " & rs("DOD") & "<br>"
Response.Write rs("picture") & "<br>"
Response.Write "Obituary: " & rs("obituary") & "<hr>" & "<br>"

rs.MoveNext
Wend

rs.Close
Set rs = Nothing
%>
</BODY>
</HTML>
(DBInputFormc.asp)

<html>
<head>
<title>Condolences</title>

</head>
<body bgcolor="white">
<center><b><font face="Times New Roman"><b><font size="+2"
color="#009933">Please send your

condolences to the family</font></b></font></center><BR>
<font face="times new roman" size="4"></b>
<center>
Information submitted will be listed on the condolences registry and
given to the family<br>

It will not be used for any other purpose.</i></font><BR>
Please complete all blanks, if you do not have an email address simply
enter

"none"</center><br>
<hr size=2 color="#B54039">
<font face="arial" size="3">
<form method="post" action="thankyou.asp">
<b>From:</B><br>
First Name:<input type="text" name="fname" size="20"><br>
Last Name:<input type="text" name="lname" size="20"><br>
Address:&nbsp&nbsp&nbsp&nbsp<input type="text" name="staddress"

size="45"><br>
City:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp<input
type="text" name="city" size="20"><br>
State:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbs p&nbsp<input
type="text"

name="state" size="15"><br>
Zip:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp& nbsp&nbsp&nbsp&nbsp&nbsp<input
type="text"

name="zip" size="20"><br>
Email:&nbsp &nbsp &nbsp &nbsp &nbsp<input type="text" name="email"

size="25"><br>
Condolences:<TEXTAREA NAME="condolences" ROWS=6
COLS=60></TEXTAREA><br>
<center><input type="submit" value="Submit!"><br><br></b></center>
</font>

</form>
</body>
</html>

(condolences.asp)
<% Response.Buffer = True %>
<html>
<head>
<title>Davis Funeral Chapel Condolences</title>
</head>
<body>
<BODY BGCOLOR="white" bgproperties="fixed">
<FONT FACE="Verdana" SIZE=4 COLOR="green">Condolences</font>
<hr color="B54039">
<FONT FACE="Verdana" SIZE="2">
<%
Dim rs
Set rs = Server.CreateObject ("ADODB.Recordset")

rs.Open "condolences", "DSN=condolences.dsn"

While Not rs.EOF
Response.Write "For the family of: " & rs("firstname") & " "
& rs("lastname") & "<br>"
Response.Write "From: " & rs("fname") & " " & rs("lname") & "<br>"
Response.Write "Address:" & rs("staddress") & "<br>"
Response.Write "" & rs("city") & " " & rs("state") & " " & rs("zip")&
"<br>"
Response.Write "Email: " & rs("email") & "<br>"
Response.Write "Condolences: " & rs("condolences") & "<hr>" & "<br>"

rs.MoveNext
Wend

rs.Close
Set rs = Nothing
%>
</BODY>
</HTML>

(thankyou.asp)
<%@language=vbscript%>
<%option explicit%>
<html>
<head>
<meta http-equiv="refresh" content="5;
URL=http://www.swishercs.com/dfc/obits.asp" target="main">
<title>Condolances</title>
<!--#include file="adovbs.inc"-->
</head>
<body bgcolor="white">
<%
DIM objCN, objRS, objProp
SET objCN = Server.CreateObject("ADODB.Connection")
objCN.ConnectionString = "DSN=condolences.dsn"
objCN.Open
SET objRS = Server.CreateObject ("ADODB.Recordset")
objRS.OPEN "condolences", objCN, adOpenDynamic, adLockOptimistic
objRS.AddNew
objRS("firstname") = Request.Form("firstname")
objRS("lastname") = Request.Form("lastname")
objRS("Fname") = Request.Form("fname")
objRS("lname") = Request.Form("lname")
objRS("email") = Request.Form("email")
objRS("condolences") = Request.Form("condolences")

objRS.Update

%>
<br><br><br>
<center><font face=Times New Roman size="5"><i>Thank you,
<%=objRS("Fname")%>&nbsp;<%=objRS("Lname")%> We will see that the
family gets your condolences</i></font></center>

</body>
</html>

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Bart Swisher wrote:
the live site can be viewed at www.davisfuneral-chapel.com,


Just when I thought Americans had lost their sense of humour we have a
"live" site for a funeral home with a big clock counting down the hours,
minutes and seconds! .... Thanks for the great laugh!

Is the "dead" site just as much fun?
Nov 13 '05 #2

P: n/a

Lyle Fairfield wrote:
Bart Swisher wrote:
the live site can be viewed at www.davisfuneral-chapel.com,
Just when I thought Americans had lost their sense of humour we have

a "live" site for a funeral home with a big clock counting down the hours, minutes and seconds! .... Thanks for the great laugh!

Is the "dead" site just as much fun?


The clock gives the current time, it is not a countdown. Thanks for
your useful suggestion to my posting.

Nov 13 '05 #3

P: n/a
rkc
Bart Swisher wrote:
I have an Access database that I have web enabled using ASP, everything
works fine except for one thing. Let me start by giving a background of
the requirements. <snip a-lot-o stuff>i.e. want to pass the deceased name from obits.asp to
DBInputFormc.asp then post it to the db.

Without a form you can append the information to the URL.

An outline in minimal aircode would be:

(Obits.ASP)

In vbscript:
dim fName, lName, appendedInfo
fName = rs("firstname")
lName = rs("lastname")
appendedInfo= "FirstName=" & fName & "&LastName=" & lName

In the HTML:
<a href="DBInputFormc.asp?<%=appendedInfo%>">Send Condolences</a>

(DBInputFormc.asp)

In vbscript:

dim fName, lName
if Request.ServerVariables("QUERY_STRING") <> "" then
fName = trim(Request.QueryString("FirstName"))
lName = trim(Request.QueryString("LastName"))
end if

Write fName and lName to the database
Nov 13 '05 #4

P: n/a

rkc wrote:
Bart Swisher wrote:
I have an Access database that I have web enabled using ASP, everything works fine except for one thing. Let me start by giving a background of the requirements.

<snip a-lot-o stuff>
>i.e. want to pass the deceased name from obits.asp to
>DBInputFormc.asp then post it to the db.

Without a form you can append the information to the URL.

An outline in minimal aircode would be:

(Obits.ASP)

In vbscript:
dim fName, lName, appendedInfo
fName = rs("firstname")
lName = rs("lastname")
appendedInfo= "FirstName=" & fName & "&LastName=" & lName

In the HTML:
<a href="DBInputFormc.asp?<%=appendedInfo%>">Send Condolences</a>

(DBInputFormc.asp)

In vbscript:

dim fName, lName
if Request.ServerVariables("QUERY_STRING") <> "" then
fName = trim(Request.QueryString("FirstName"))
lName = trim(Request.QueryString("LastName"))
end if

Write fName and lName to the database


Thank you, I will give it a try
Bart

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.