<% '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' accountupdate.asp ' ' Written by Brian Balestri ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Call Main '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Sub Main ' ' Processing for this page starts in this routine. It ' contains a dispatcher to call the appropriate routine, ' based on what function was needed. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Main Dim cnDB ' As ADODB.Connection Set cnDB = OpenDB() CheckCookie Select Case Request(ACTION) Case ACTION_UPDATE_SAVE UpdateSave cnDB Case ACTION_DELETE Delete cnDB Case ACTION_DELETE_SAVE DeleteSave cnDB Case Else BuildForm cnDB, "" End Select cnDB.Close End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Sub BuildForm ' ' This routine displays a data entry and display form. It ' is used for the create, retrieve, and update modes. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub BuildForm(cnDB, strError) Dim strFirstName Dim strLastName Dim strCurrLastName Dim strEmail Dim strKeepPrivate Dim strNewsletter Dim strUserName Dim strPassword Dim strAddress1 Dim strAddress2 Dim strCity Dim strState Dim strZipCode Dim strHomePhone Dim strWebsite Dim strMarried Dim strNoOfKids Dim strPets Dim strHobbies Dim strJobTitle Dim strCompany Dim strBizPhone Dim strIndustry Dim strJobFunction Dim strStatus Dim strStillFriends Dim strHopingToSee Dim strStaying Dim strFavTeacher Dim strWorstTeacher Dim strFavMemory Dim strWorstMemory Dim strFavQuote Dim strFavWebsite Dim strContactNotes Dim datModDate Dim strTitle Dim strAction Dim strSQL Dim rsData ' As ADODB.Recordset strUserName = Request.Cookies("Reunion")("UserName") If strError = "" Then strAction = ACTION_UPDATE_SAVE strTitle = "Update Your Account Information" strSQL = "SELECT * FROM tblContacts " _ & "WHERE (UserName Like " & DQ & strUserName & DQ & ")" Set rsData = cnDB.Execute(strSQL) strFirstName = rsData("FirstName") strLastName = rsData("LastName") strCurrLastName = rsData("CurrLastName") strEmail = rsData("Email") strKeepPrivate = rsData("KeepPrivate") strNewsletter = rsData("Newsletter") strUserName = rsData("UserName") strPassword = rsData("Password") strAddress1 = rsData("Address1") strAddress2 = rsData("Address2") strCity = rsData("City") strState = rsData("State") strZipCode = rsData("ZipCode") strHomePhone = rsData("HomePhone") strWebsite = rsData("Website") strMarried = rsData("Married") strNoOfKids = rsData("NoOfKids") strPets = rsData("Pets") strHobbies = rsData("Hobbies") strJobTitle = rsData("JobTitle") strCompany = rsData("CompanyName") strBizPhone = rsData("BizPhone") strIndustry = rsData("Industry") strJobFunction = rsData("JobFunction") strStatus = rsData("Status") strStillFriends = rsData("StillFriends") strHopingToSee = rsData("HopingToSee") strStaying = rsData("Staying") strFavTeacher = rsData("FavTeacher") strWorstTeacher = rsData("WorstTeacher") strFavMemory = rsData("FavMemory") strWorstMemory = rsData("WorstMemory") strFavQuote = rsData("FavQuote") strFavWebsite = rsData("FavWebsite") strContactNotes = rsData("ContactNotes") datModDate = Date() rsData.Close Set rsData = Nothing Else strAction = ACTION_UPDATE_SAVE strTitle = "Update Your Account" strFirstName = Request("dbtFirstName") strLastName = Request("dbtLastName") strLastName = Request("dbtCurrLastName") strEmail = Request("dbtEmail") strKeepPrivate = Request("dbtKeepPrivate") strNewsletter = Request("dbtNewsletter") strUserName = Request("dbtUserName") strPassword = Requets("dbtPassword") strAddress1 = Request("dbtAddress1") strAddress2 = Request("dbtAddress2") strCity = Request("dbtCity") strState = Request("dbtState") strZipCode = Request("dbtZipCode") strHomePhone = Request("dbtHomePhone") strWebsite = Request("dbtWebsite") strMarried = Request("dbtMarried") strNoOfKids = Request("dbtNoOfKids") strPets = Request("dbtPets") strHobbies = Request("dbtHobbies") strJobTitle = Request("dbtJobTitle") strCompany = Request("dbtCompanyName") strBizPhone = Request("dbtBizPhone") strIndustry = Request("dbtIndustry") strJobFunction = Request("dbtJobFunction") strStatus = Request("dbtStatus") strStillFriends = Request("dbtStillFriends") strHopingToSee = Request("dbtHopingToSee") strStaying = Request("dbtStaying") strFavTeacher = Request("dbtFavTeacher") strWorstTeacher = Request("dbtWorstTeacher") strFavMemory = Request("dbtFavMemory") strWorstMemory = Request("dbtWorstMemory") strFavQuote = Request("dbtFavQuote") strFavWebsite = Request("dbtFavWebsite") strContactNotes = Request("dbtContactNotes") imgPicture = Request("dbtPicture") datModDate = Date() End If PrintHeader strTitle If strError <> "" Then WL "

" & strError & "

" End If WL "
" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" If strWebsite <> "" Then WL "" Else WL "" End If WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" WL "" If strFavWebsite <> "" Then WL "" Else WL "" End If WL "" WL "" WL "" WL "
" WL "Account Information" WL "
First Name:
High School Last Name:
Current Last Name:
Email Address:
Keep Email Address Private:
Do you want to receive the never-more-than-once-a-week newsletter?
UserName:" & strUserName & "
Password:" & strPassword & "
" WL "Contact Information" WL "
Home Address:
City:
State (Abrev.):
Zip Code:
Home Phone:
Website:
" WL "Family Information" WL "
Marital Status:

" WL "
Number of Kids:
Pets:
Hobbies:
" WL "Career Information" WL "
Job Title:
Company Name:
Bus. Phone:
Industry:
Job Function:
" WL "Reunion Information" WL "
Reunion Status:
Number of high school friends you " _ & "still see on a regular basis:
Who are you hoping to see at the reunion?
Where you are staying for the reunion?
" WL "High School Memories" WL "
Favorite H/S Teacher:
Worst H/S Teacher:
Favorite H/S Memory:
Worst/Most Embarrassing H/S Memory:
" WL "Miscellaneous Stuff" WL "
Favorite Quote:
Favorite Quirky/Off-beat Website:
Personal Description / Misc. Notes:
" _ & "" _ & " " _ & "
" PrintFooter End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' Sub UpdateSave ' ' This routine performs an update on the table for this ' particular item. ' ''''''''''''''''''''''''''''''''''''''''''''''''''' Sub UpdateSave(cnDB) Dim rsData ' As ADODB.Recordset Dim strUserName If Not ValidateData(cnDB) Then Exit Sub strUserName = Request("UserName") Set rsData = Server.CreateObject("ADODB.Recordset") rsData.Open "SELECT * FROM tblContacts " _ & "WHERE (UserName Like " & DQ & strUserName & DQ & ")", cnDB, adOpenDynamic, adLockOptimistic rsData("ModDate") = Request("ModDate") rsData("FirstName") = Request("dbtFirstName") rsData("LastName") = Request("dbtLastName") rsData("CurrLastName") = Request("dbtCurrLastName") rsData("Email") = Request("dbtEmail") rsData("Newsletter") = Request("dbtNewsletter") rsData("Address1") = Request("dbtAddress1") rsData("Address2") = Request("dbtAddress2") rsData("City") = Request("dbtCity") rsData("State") = Request("dbtState") rsData("ZipCode") = Request("dbtZipCode") rsData("HomePhone") = Request("dbtHomePhone") rsData("Website") = Request("dbtWebsite") rsData("Married") = Request("dbtMarried") rsData("NoOfKids") = Request("dbtNoOfKids") rsData("Pets") = Request("dbtPets") rsData("Hobbies") = Request("dbtHobbies") rsData("JobTitle") = Request("dbtJobTitle") rsData("CompanyName") = Request("dbtCompanyName") rsData("BizPhone") = Request("dbtBizPhone") rsData("Industry") = Request("dbtIndustry") rsData("JobFunction") = Request("dbtJobFunction") rsData("Status") = Request("dbtStatus") rsData("StillFriends") = Request("dbtStillFriends") rsData("HopingToSee") = Request("dbtHopingToSee") rsData("Staying") = Request("dbtStaying") rsData("FavTeacher") = Request("dbtFavTeacher") rsData("WorstTeacher") = Request("dbtWorstTeacher") rsData("FavMemory") = Request("dbtFavMemory") rsData("WorstMemory") = Request("dbtWorstMemory") rsData("FavQuote") = Request("dbtFavQuote") rsData("FavWebsite") = Request("dbtFavWebsite") rsData("ContactNotes") = Request("dbtContactNotes") rsData.Update rsData.Close PrintHeader "Thank You!" WL "

Thank you for updating your account with the rest " _ & "of your information.

" WL "

The next step is to check out your classmates. " WL "Or, you might also want take our Fun Facts Survey (a.k.a. " _ & "I Never... link on the menu).

" WL "

When you are finished with that survey, you can see " _ & "how your answers fit in with the rest of your classmates. " WL "Just click the Fun Facts " WL "link.

And remember, it's all just for fun.

" WL "

Enjoy!

" WL "

" PrintFooter End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' Function ValidateData ' ' This routine validates the input data and ' causes the form to be shown if the data is ' not correct. A True result indicates that ' the data was OK, and a False indicates that ' the data was in error. ' ''''''''''''''''''''''''''''''''''''''''''''''''''' Function ValidateData(cnDB) Dim strError ' As String strError = "" If Request("dbtLastName") = "" _ And Request("dbtFirstName") = "" Then strError = strError _ & "
  • Please enter your first name or last name." End If If strError <> "" Then strError = "

    " _ & "The following data errors were detected:
    " _ & "

    " BuildForm cnDB, strError ValidateData = False Else ValidateData = True End If End Function %>