<% strUserName = session("UserName2") Response.Expires = 0 Response.Buffer = True ' Create a recordset object to store specific table information Set objRS = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From TblLogin where (UserName = '" + strUserName + "')" 'Set the recordset object equal to the SQL query string objRS.Open SQL, objADO, 1, 3 'Retrieving database info. strUserName = objRs.Fields("UserName") strPassword = objRs.Fields("Password") strLastName = objRs.Fields("LastName") strFirstName = objRs.Fields("FirstName") strAddress = objRs.Fields("Address") strCity = objRs.Fields("City") strState = objRs.Fields("State") strZip = objRs.Fields("Zip") strPhoneNumber = objRs.Fields("PhoneNumber") strFaxNumber = objRs.Fields("FaxNumber") strEmailAddress = objRs.Fields("EmailAddress") strReceiveMail = objRs.Fields("ReceiveMailings") strAction = request("cmdAction") if Request.Form <> "" and strAction = "No" then Response.Redirect "viewusers.asp" end if if Request.Form <> "" and strAction = "Yes" then objRs.close set objRs = nothing ' Create a recordset object to store specific table information Set objRS1 = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * from CDListing where (CDUserName = '" + strUserName + "')" 'Set the recordset object equal to the SQL query string objRS1.Open SQL, objADO, 1, 3 if objRs1.EOF then ' Create a recordset object to store specific table information Set objRS = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Delete * From TblLogin where (UserName = '" + strUserName + "')" 'Set the recordset object equal to the SQL query string objRS.Open SQL, objADO, 1, 3 Response.Redirect "viewusers.asp" else WarningErrMsg = "
User Name: " & strUserName & " owns " & objrs1.RecordCount & " real estate listings. This account can not be deleted until all associated real estate listings are first deleted." warningErrMsg = warningErrMsg + "
Click here to first delete their real estate listings." end if end if %>

DELETE USER ACCOUNT

Are you sure you want to delete the account?
Yes will Delete the account, and then redirect you back to the view users page. No will redirect you back to the view users page without deleting the account.

<% if WarningErrMsg <> "" then %>
Error(s):<%= warningErrMsg %>
<% end if %>
User Name: <%= session("UserName2") %>
Password: <%= objrs("Password") %>
First Name: <%= strFirstName %>
Last Name: <%= strLastName %>
Address: <%= strAddress %>
City: <%= strCity %>
State: <%= strState %>
Zip Code: <%= strZip %>
Email Address: <%= strEmailAddress %>
Phone #: <%= strPhoneNumber %>
Fax #: <%= strFaxNumber %>