Student_del_confirm.asp
Page source
Delete confirmation
Confirm deletion of: John Jones
Script listing
Delete confirmation
<%
' 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("Confirm deletion of: " & fn & " " & ln & "")
Response.write ("
")
' List roster form
Response.Write ("")
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
%>