473,545 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response redirecting a querystring

Hi there,

I have a ASP/SQL 7.0 Application and i have a page (page1.asp) that has 2
ways of accessing it.

1 is through a hyperlink on another page (page2.asp), that inserts a value
into a querystring and page1.asp output data from sql according to the
relevant value in the hyperlink =
***page2***

<a href= "page1.asp?valu e=<% =RS("value")%>" ><% =RS("value")%></a>

***page 1***
Set RS = DataConnection. Execute("SELECT fields FROM view WHERE view.col1='"
& request.queryst ring("value") & "'")
***********

This works OK and i can output the data fine in accordance to the select
statement.

The other way of accessing this page is through page3.asp, which has a text
box and upon clicking submit the value in the text box is put into the
querystring. (this value will be the same as the hyperlink on page 2)=

***page3.asp***

If Request.Form("b tn") = "Submit" Then
If Request.Form("t extbox") <> "" Then
Dim value
value = Request.Form("t extbox")
Response.redire ct("page1.asp?v alue='"& value &"'")
Else
Response.Write( "Please enter your value")
End If
End If

**************

This doesnt work and returns a invalid syntax error, and also saying that
there is no record.
The URL has ' around the value. ie URL = .....page1.asp? value='value'
(rather than_ .....page1.asp? value=value
Why would 1 work and not the other????

Help (and sorry if its a tad confusing)

--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com
Jul 19 '05 #1
7 3548
> This doesnt work and returns a invalid syntax error, and also saying that
there is no record.
The URL has ' around the value. ie URL = .....page1.asp? value='value'
(rather than_ .....page1.asp? value=value
Why would 1 work and not the other????


Remove the single quotes around the value - you're getting a syntax error
because those single quotes are also included in your sql statement.

R
Jul 19 '05 #2
i dont know where you mean? the quotes are needed for the -
Response.redire ct("page1.asp?v alue='"& value &"'")
and when i remove the quotes manually in the URL, i get -

Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted. Requested
operation requires a current record.
/ltsb/summary_BM.asp

i don't know why it can read 1 data string ok (and get a record), and not
another??? as both have the same name as the select statement.
--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com
"Randy Rahbar" <rvrahbar@_JUNK ETY_JUNK_hotmai l.com> wrote in message
news:ei******** ******@TK2MSFTN GP09.phx.gbl...
This doesnt work and returns a invalid syntax error, and also saying that there is no record.
The URL has ' around the value. ie URL = .....page1.asp? value='value'
(rather than_ .....page1.asp? value=value
Why would 1 work and not the other????


Remove the single quotes around the value - you're getting a syntax error
because those single quotes are also included in your sql statement.

R

Jul 19 '05 #3
Response.write the sql statement....

Response.write "SELECT fields FROM view WHERE view.col1='" &
request.queryst ring("value") & "'")
Response.end

Do this at the top of page 1 and you can check out the values being passed
into the sql statement.
Jul 19 '05 #4
i cant as i cant display the page.
How should it look?

--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com
"Randy Rahbar" <rvrahbar@_JUNK ETY_JUNK_hotmai l.com> wrote in message
news:ee******** ******@TK2MSFTN GP10.phx.gbl...
Response.write the sql statement....

Response.write "SELECT fields FROM view WHERE view.col1='" &
request.queryst ring("value") & "'")
Response.end

Do this at the top of page 1 and you can check out the values being passed
into the sql statement.

Jul 19 '05 #5
When it works, the URL has no - ' - but the SQL Statement does, at the top
of the page.

How should the response redirect work?
--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com
"Randy Rahbar" <rvrahbar@_JUNK ETY_JUNK_hotmai l.com> wrote in message
news:ee******** ******@TK2MSFTN GP10.phx.gbl...
Response.write the sql statement....

Response.write "SELECT fields FROM view WHERE view.col1='" &
request.queryst ring("value") & "'")
Response.end

Do this at the top of page 1 and you can check out the values being passed
into the sql statement.

Jul 19 '05 #6
> How should the response redirect work?

When redirecting from page 3, remove the single quotes and just do something
like this..

page1.asp?value =" & value

If you get a BOF or EOF error on page1, then that value probably doesn't
exist in the database. After you make that change, response.write your sql
statement and see what you get.

Hopefully this all makes sense,
Randy
Jul 19 '05 #7
sorry about all that confusion, i did that and it all works. Aint ASP a
finacy thing (if your new)

Thanks for all your help

--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com
"Randy Rahbar" <rvrahbar@_JUNK ETY_JUNK_hotmai l.com> wrote in message
news:Oe******** ******@TK2MSFTN GP10.phx.gbl...
How should the response redirect work?
When redirecting from page 3, remove the single quotes and just do

something like this..

page1.asp?value =" & value

If you get a BOF or EOF error on page1, then that value probably doesn't
exist in the database. After you make that change, response.write your sql statement and see what you get.

Hopefully this all makes sense,
Randy

Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5103
by: Lam | last post by:
I try to use qs = Server.URLEncode(Request.Querystring) session("fromURL") = request.ServerVariables("HTTP_REFERER")& Server.HTMLEncode(qs) on the login page then on the next page I use response.redirect session("fromURL") the following extra characters got appended at the end of the URL
6
3027
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a cookie (say Response.Cookies ("TEST")) and you have a query string variable &test=x or &Test=x and you get Request.QueryString to parse the query...
4
8392
by: Max Dupenois | last post by:
I've seen numerous articles with similair (similar sp?) titles to this in my search.. unfortunately none of them seem to contain what i want, (or if they do i need someone to point out my stupidity for me :p ) Anyway I have a file dialog box being opened using Response.AddHeader "Content-Disposition", "attachment;filename=""" &...
2
3691
by: Stephan Bour | last post by:
I have a vexing problem I hope someone can help me with: I have an ASP.Net site that allows users to place orders for biological materials. Once the order is done though, I would like to have two pieces of information automatically entered into textfields on a form managed by a different site on a different server. I can do a...
3
1525
by: tshad | last post by:
I am using method=POST in my Form field, but am also using response.redirects to go to my next pages. response.redirect("x.aspx?a=1) But the a=1 shows in the query string. I thought the Post method was supposed to put the querys into the page and not the URL? I am trying to take some of my pages that already are doing redirects and...
5
4548
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks a session variable, and if it is not present, does a Response.Redirect to a webpage for the CAS passing a url parameter for the url to post back...
2
2065
by: Me | last post by:
I am passing on the input name to my asp page using Response.redirect "mypage.asp?name=" & name and the resulting url looks like 'companyname/mypage.asp?name=" & name I would like it to appear like 'companyname' or at most 'companyname/mypage.asp' how can I do it?
12
1491
by: gigi | last post by:
How to send more than one value using response redirect? For example i can send one like this response.Redirect "pregled.asp?ime=" & strUserName but how to send two or more values? I tried response.Redirect("pregled.asp?ime=" & strUserName & " & prezime = " & strUserLastName) but it didn't work.
4
11937
by: AAaron123 | last post by:
trying to understand the below shown code. After this is run the browser opens a file-save dialog box for saving the file. I wonder how it knows I want the file saved? But more important, the dialog box has as the default file name the name of this ashx file. I'd like to make that name more meaningfull but don't know how it gets set....
0
7490
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7682
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7935
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6009
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5351
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.