My Little Help Desk - ASP Help Forum
My Little Help Desk - ASP Help Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 My Little Help Desk - ASP Help
 Active Server Pages
 update or delete question
 New Topic  Reply to Topic
Author Topic  

MGIT

1 Posts

Posted - 12/13/2006 :  08:58:57  Show Profile  Reply with Quote
I have a question posted on experts it is still active,
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_22085548.html
I am not getting it. I need to just update a row, I have decide not to delete thinking just adding to a row then just showing the ones that = 0 would be easier. I have been working on this project for weeks now, and am getting frustrated. If you have any questions about what I have done so far please let me know.
I have a checkbox page for starters, then I have a form for address which brings in the value of the checkboxes, on the last page I am wanting to add the info from the second page into a new table, email that info and then either delete or update the original table. I hope that dosen't sound to crazy. My last page code currently looks like this.
<FORM NAME="form2" ACTION="outletupdate.asp" METHOD=POST ID="Form2">
<%

dim serial
'get Order ID from Request Form page
serial = Request.form("serial")

%>

<%
if serial = "" then
Response.Write "Enter Serial Number"

else %>


<%

Dim Class2
'On Error Resume Next
%>

<%

Set Class2 = Server.CreateObject("ADODB.Recordset")
Class2.Open "Outletsold",strConnect,adOpenKeyset,adLockOptimistic
Class2.AddNew
Class2.Fields("serial") = Request.Form("serial")
Class2.Fields("firstname") = Request.Form("firstname")
Class2.Fields("lastname") = Request.Form("lastname")
Class2.Fields("email") = Request.Form("email")
Class2.Fields("street") = Request.Form("street")
Class2.Fields("city") = Request.Form("city")
Class2.Fields("state") = Request.Form("state")
Class2.Fields("zip") = Request.Form("zip")
Class2.Fields("telephone") = Request.Form("telephone")
Class2.Fields("dateentered") = Date
Class2.Update
Class2.Close
If Err.Number = 0 Then
%>

<!--New e-mail-->
<%

Dim firstname, lastname, email, street, city, state, zip, telephone

firstname = Trim(Request.Form("firstname"))
lastname = Trim(Request.Form("lastname"))
email = Trim(Request.Form("email"))
street = Trim(Request.Form("street"))
city = Trim(Request.Form("city"))
state = Trim(Request.Form("state"))
zip = Trim(Request.Form("zip"))
telephone = Trim(Request.Form("telephone"))
outlettake = Trim(Request.Form("outlettake"))
comments = Trim(Request.Form("comments"))

If (firstname <> "" and lastname <> "" ) Then

Dim objMail, aRecipients, message
Set objMail = Server.CreateObject("CDONTS.NewMail")

objMail.From = email
objMail.To = "kellyruggiero@mgandbw.com"
objMail.Subject = "Outlet " & serial

'aRecipients = Array("markschindler@mitchellgold.com")
'objMail.BCC = Join(aRecipients, ";" )
objMail.Body = "First Name: " & firstname & VBCrLf & "Last Name: " & lastname & VBCrLf & "Street: " & Street & VBCrLf &"City: " & city & VBCrLf & "State: " & state & VBCrLf & "Zip: " & zip & VBCrLf & "Phone: " & telephone & VBCrLf & "Outlet Take: " & outlettake & VBCrLf & "Comments: " & comments
objMail.Send



Else
%>
<FORM ACTION="<%=Request.ServerVariables("SCRIPT_NAME")%>" METHOD=POST id=form7 name=form7>
<%

end if
end if
end if


SQL = "UPDATE outletsales SET Show=-1 WHERE Serial='" & Left(Request.Form("Serial"),Len(Request.Form("Serial"))-2) & "'"
Class2.Execute SQL, strConnect




IF Class2.State <> 0 THEN Class2.Close
SQL = "SELECT * FROM outletsales WHERE Serial='" & Request.Form("Serial") & "'"
Class2.CursorType = 1
Class2.Open SQL, strConnect
Response.Write "NUMBER OF RETURNED RECORDS = " & Class2.RecordCount



%>

alorentz

66 Posts

Posted - 12/16/2006 :  12:44:40  Show Profile  Reply with Quote
Sorry for the delay MGIT. So what is the actual problem?
Go to Top of Page

alorentz

66 Posts

Posted - 12/16/2006 :  12:46:12  Show Profile  Reply with Quote
In short, you should never delete anything...so your idea of updating a field to 0 to show delete is best.
Go to Top of Page
  Topic  
 New Topic  Reply to Topic
Jump To:
My Little Help Desk - ASP Help Forum © mylittlehelpdesk.com Go To Top Of Page
Snitz Forums 2000