Answered
create asp querystring in redirect script
I have an asp page containing an update record script and a
redirect script. Update record is filtered WHERE
contactid_mor="&Request.Form("contactid_mor")&" ")
I would like to pass on a querystring to the redirect page that is equivalent to companyid_mor which is a field in the same table as contactid_mor. How do I go about doing this? Do I create a recordset and then make the querysting equal to the recordset field?
The code follows:
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/access_db/products.mdb")
objConn.Open
objConn.Execute("UPDATE morecontacts_mor SET firstnm_mor='"&Request.Form("firstnm_mor")&"', lastnm_mor='"&Request.Form("lastnm_mor")&"', phone_mor='"&Request.Form("phone_mor")&"', altphone_mor='"&Request.Form("altphone_mor")&"', fax_mor='"&Request.Form("fax_mor")&"', cellphone_mor='"&Request.Form("cellphone_mor")&"', email_mor='"&Request.Form("email_mor")&"', altemail_mor='"&Request.Form("altemail_mor")&"' WHERE contactid_mor="&Request.Form("contactid_mor")&" ")
Response.Redirect("invoice.asp?customerid=%>
I would like to pass on a querystring to the redirect page that is equivalent to companyid_mor which is a field in the same table as contactid_mor. How do I go about doing this? Do I create a recordset and then make the querysting equal to the recordset field?
The code follows:
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/access_db/products.mdb")
objConn.Open
objConn.Execute("UPDATE morecontacts_mor SET firstnm_mor='"&Request.Form("firstnm_mor")&"', lastnm_mor='"&Request.Form("lastnm_mor")&"', phone_mor='"&Request.Form("phone_mor")&"', altphone_mor='"&Request.Form("altphone_mor")&"', fax_mor='"&Request.Form("fax_mor")&"', cellphone_mor='"&Request.Form("cellphone_mor")&"', email_mor='"&Request.Form("email_mor")&"', altemail_mor='"&Request.Form("altemail_mor")&"' WHERE contactid_mor="&Request.Form("contactid_mor")&" ")
Response.Redirect("invoice.asp?customerid=%>
