<% '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' questions.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() Select Case Request(ACTION) Case ACTION_UPDATE_SAVE UpdateSave 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) Dim strSchooling Dim strWorstJob Dim strRegrets Dim strCrush Dim strWishDate Dim strPolitics Dim strTimesMarried Dim strReligion Dim strJobFeelings Dim strOrientation Dim strPrison Dim strUserName Dim strTitle Dim strNotice Dim strAction Dim strSQL Dim rsData ' As ADODB.Recordset If Request.Cookies("Reunion")("UserName") <> "" Then strTitle = "WARNING!" strNotice = "You should really " _ & "log out before answering these questions. " _ & "Otherwise they won't be anonymous. The Logout button is in the " _ & "upper right corner. Once you have logged out, come back " _ & "to the I Never... page and answer the questions." Else strTitle = "Fun Facts Survey" strNotice = "

The following questions are just for fun. " _ & "They are totally anonymous so please be honest.

" _ & "

After you are finished answering the questions " _ & "go to the Fun Facts page to see the results.

" End If If Request.Cookies("SysMod") = "" Then PrintHeader "Under Construction" WL "

Sorry for the inconvenience, but this page is " _ & " currently under construction.

Please check back again later.

" PrintFooter Exit Sub End If strUserName = Request.Cookies("SysMod") strAction = ACTION_UPDATE_SAVE strSQL = "SELECT * FROM tblContacts " _ & "WHERE (UserName Like " & DQ & strUserName & DQ & ")" Set rsData = cnDB.Execute(strSQL) strSchooling = "" strWorstJob = "" strRegrets = "" strCrush = "" strWishDate = "" strPolitics = "" strTimesMarried = "" strReligion = "" strJobFeelings = "" strOrientation = "" strPrison = "" rsData.Close Set rsData = Nothing PrintHeader strTitle 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 "
" & strNotice & "

What is the highest level of schooling you completed?
" WL "


What is the worst job you have had since leaving high school?
" WL "


What regrets, if any, do you have about your high school days?
" WL "


On whom did you have a secret (or not so secret) crush?
" WL "


Who did you wish you had asked out (or them " _ & "ask you out)?
" WL "

What political party do you align with the most?
" WL "

How many times have you been married?
" WL "

How would you describe your feelings about your work?
" WL "

What religion are you?
" WL "

What is your true sexual orientation?
" WL "

Have you ever done time in jail or prison? If so, " _ & "for how long and what did you do?
" WL "

" _ & "" _ & " " _ & "
" 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 strUserName = Request("UserName") Set rsData = Server.CreateObject("ADODB.Recordset") rsData.Open "SELECT * FROM tblContacts " _ & "WHERE (UserName Like " & DQ & strUserName & DQ & ")", cnDB, adOpenDynamic, adLockOptimistic rsData("Schooling") = Request("dbtSchooling") rsData("WorstJob") = Request("dbtWorstJob") rsData("Regrets") = Request("dbtRegrets") rsData("Crush") = Request("dbtCrush") rsData("WishDate") = Request("dbtWishDate") rsData("Politics") = Request("dbtPolitics") rsData("TimesMarried") = Request("dbtTimesMarried") rsData("Religion") = Request("dbtReligion") rsData("JobFeelings") = Request("dbtJobFeelings") rsData("Orientation") = Request("dbtOrientation") rsData("Prison") = Request("dbtPrison") rsData.Update rsData.Close PrintHeader "Thank You!" WL "

Thank you for participating in our Fun Facts Survey.

" WL "

To see how your answers fit in with the rest of your classmates, " WL "Click the Fun Facts " WL "link.

Remember, it's all in fun.

" WL "

Enjoy!

" WL "

" PrintFooter End Sub %>