Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

create asp querystring in redirect script

Participant ,
Feb 08, 2007 Feb 08, 2007
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=%>
TOPICS
Server side applications
433
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 08, 2007 Feb 08, 2007
The Server.Transfer method [1] does not support the objective.

' fool around with this implementation...
dim sQueryStringValue
sQueryStringValue = "PuxatawneyPhil"
Response.Redirect("invoice.asp?customerid=" & sQueryStringValue)

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h

[1] http://msdn2.microsoft.com/en-us/library/ms525800.aspx


"aonefun" <webforumsuser@m...
Translate
LEGEND ,
Feb 08, 2007 Feb 08, 2007
Change your response.redirect to server.transfer and use the form as though
it were submitted to that page
-or-
Add ?<%=Request.Form%> to the end of the redirect URL and the query string
values will have the same names as the form values.


"aonefun" <webforumsuser@macromedia.com> wrote in message
news:eqflse$o4e$1@forums.macromedia.com...
>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=%>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 08, 2007 Feb 08, 2007
The Server.Transfer method [1] does not support the objective.

' fool around with this implementation...
dim sQueryStringValue
sQueryStringValue = "PuxatawneyPhil"
Response.Redirect("invoice.asp?customerid=" & sQueryStringValue)

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h

[1] http://msdn2.microsoft.com/en-us/library/ms525800.aspx


"aonefun" <webforumsuser@macromedia.com> wrote in message
news:eqflse$o4e$1@forums.macromedia.com...
>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=%>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 08, 2007 Feb 08, 2007
excuse my naivete, but would such a statement or syntax be possible? it's giving me "expected end of statement" errors.

sQueryStringValue = "Recordset1.Fields.Item("customerid_mor").Value"
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 09, 2007 Feb 09, 2007
LATEST
Despite its current sparse UI the ASP FAQ [1] is an amazing resource. Go
there and type the error message into the search textbox. I'm doing C# these
days and wrote the snippet from memory. I'm not too sharp on ASP errors
lately but I think I do see the problem with your code; remove the
quotations from the reference to the property of the Field...

sQueryStringValue = Recordset1.Fields.Item("customerid_mor").Value

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h

[]1 http://aspfaq.com/


"aonefun" <webforumsuser@macromedia.com> wrote in message
news:eqgt32$8j5$1@forums.macromedia.com...
> excuse my naivete, but would such a statement or syntax be possible? it's
> giving me "expected end of statement" errors.
>
> sQueryStringValue = "Recordset1.Fields.Item("customerid_mor").Value"


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines