Student_del_confirm.asp

Page source

<html> <head> <style type="text/css"> <!-- body { font-family: Verdana } --> </style> <title>Delete confirmation</title> </head> <body bgcolor="#ffffff"> <b>Confirm deletion of:</b> John Jones<p> <form action="student_del.asp?RecID=47" method ="post"> <INPUT TYPE="submit" NAME="button" VALUE="Delete"></INPUT> <p> </FORM> <FORM ACTION="roster_view.asp" METHOD="post"> <INPUT TYPE="submit" NAME="button" VALUE="Return To Roster"></INPUT> </FORM> </body> </html>

Script listing

<html> <head> <style type="text/css"> <!-- body { font-family: Verdana } --> </style> <title>Delete confirmation</title> </head> <body bgcolor="#ffffff"> <% ' This script displays the name from the record to be deleted, ' and asks the user to confirm that action. Dim rID 'record ID Dim fn 'first name Dim ln 'last name rid = Request.QueryString("RecID") getnames(rID) ' get the first and last names ' Deletion form Response.Write("<b>Confirm deletion of:</b> " & fn & " " & ln & "<p>") Response.write ("<form action=""student_del.asp?RecID=" & cstr(rID) & """ " & "method = ""post"">") Response.Write("<INPUT TYPE=""submit"" NAME=""button"" VALUE=""Delete""></INPUT>") Response.Write("<p>") Response.Write("</FORM>") ' List roster form Response.Write ("<FORM ACTION=""roster_view.asp"" ""method=""post"">") Response.Write("<INPUT TYPE=""submit"" NAME=""button"" VALUE=""Return To Roster""></INPUT>") Response.Write("</FORM>") Function Getnames (rID) ' This function reads the record rID and ' assigns the first and last names to fn and ln. Dim DataConn, rsRoster ' Create and establish data connection called "DataConn" Set DataConn = Server.CreateObject("ADODB.Connection") DataConn.ConnectionTimeout = 5 DataConn.CommandTimeout = 12 DataConn.Open Session.Value("DBOpen") ' Create recordset and retrieve values for record rID Set rsRoster = Server.CreateObject("ADODB.Recordset") Dim cmdText cmdText = "SELECT FirstName,LastName FROM Roster_CIS " & " WHERE RecID = " & rID rsRoster.Open cmdText, DataConn, 0, 1, 1 'forward-only cursor (0), read-only mode (1) fn = rsRoster.Fields("FirstName") ln = rsRoster.Fields("LastName") ' Close Data Access Objects and free DB variables rsRoster.Close ' return connection and dataset memory Set rsRoster = Nothing DataConn.Close Set DataConn = Nothing End Function %> </body> </html>

Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.