%
strUserName = session("UserName")
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 "menu.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 "Logout.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 delete your real estate listings."
end if
end if
%>
DELETE YOUR ACCOUNT
Are you sure you want to delete your account?
Yes will Delete the account, and then redirect you back to the home page. No will redirect you back to the Control Panel.
<% end if %>
Error(s):<%= warningErrMsg %>