/secure/admin/DisplayEventVisitors.asp

https://github.com/barrynovak5/SWOGC · ASP · 68 lines · 49 code · 14 blank · 5 comment · 0 complexity · 847771210b7a596e4bdf8d7160c020b9 MD5 · raw file

  1. <!--#include file=adovbs.inc -->
  2. <%
  3. donationEventId = Request.Querystring("ID")
  4. donationEventName = Request.Querystring("Name")
  5. //Response.Write(donationEventId)
  6. Set objConn = Server.CreateObject("ADODB.Connection")
  7. Set objCmd = Server.CreateObject("ADODB.Command")
  8. Set objRS = Server.CreateObject("ADODB.Recordset")
  9. objConn.Open "FourC"
  10. objRS.CursorType = adOpenForwardOnly
  11. objRS.LockType = adLockOptimistic
  12. Set objCmd.ActiveConnection = objConn
  13. 'If a SQL statement with question marks is specified, then the
  14. 'CommandType is adCmdText. If a query name is specified, then
  15. 'the CommandType is adCmdStoredProc.
  16. Dim fieldList
  17. fieldList = "DonorFirstName, DonorLastName, DonorCompany, DonorAddress, DonorAddress2, DonorCity, DonorState, DonorZipCode, DonorPhoneDayOrEvening, DonorEmailAddress"
  18. objCmd.CommandText = "SELECT " & fieldList & " FROM Donations WHERE Donations.AddToNewsletter = True AND Donations.EventID = ?"
  19. objCmd.CommandType = adCmdText
  20. 'Create the parameter and populate it.
  21. Set objParam = objCmd.CreateParameter("@EVENTID" , adInteger, adParamInput, 0, 0)
  22. objCmd.Parameters.Append objParam
  23. objCmd.Parameters("@EVENTID") = donationEventId
  24. 'Open and display the Recordset.
  25. objRS.Open objCmd
  26. %>
  27. <h2><%= donationEventName %></h2>
  28. <table border=1 cellpadding=2 cellspacing=2>
  29. <tr>
  30. <%
  31. For I = 0 To objRS.Fields.Count - 1
  32. Response.Write "<td><b>" & objRS(I).Name & "</b></td>"
  33. Next
  34. %>
  35. </tr>
  36. <%
  37. //objRS.MoveFirst
  38. Do While Not objRS.EOF
  39. Response.Write "<tr>"
  40. For I = 0 To objRS.Fields.Count - 1
  41. Response.Write "<td>" & objRS(I) & "</td>"
  42. Next
  43. Response.Write "</tr>"
  44. objRS.MoveNext
  45. Loop
  46. %>
  47. </table>
  48. <%
  49. objRS.Close
  50. objConn.Close
  51. Set objRS = Nothing
  52. Set objCmd = Nothing
  53. Set objConn = Nothing
  54. %>