473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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?value=<% =RS("value")%>"><% =RS("value")%></a>

***page 1***
Set RS = DataConnection.Execute("SELECT fields FROM view WHERE view.col1='"
& request.querystring("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("btn") = "Submit" Then
If Request.Form("textbox") <> "" Then
Dim value
value = Request.Form("textbox")
Response.redirect("page1.asp?value='"& 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 3543
> 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.redirect("page1.asp?value='"& 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@_JUNKETY_JUNK_hotmail.com> wrote in message
news:ei**************@TK2MSFTNGP09.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.querystring("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@_JUNKETY_JUNK_hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
Response.write the sql statement....

Response.write "SELECT fields FROM view WHERE view.col1='" &
request.querystring("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@_JUNKETY_JUNK_hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
Response.write the sql statement....

Response.write "SELECT fields FROM view WHERE view.col1='" &
request.querystring("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@_JUNKETY_JUNK_hotmail.com> wrote in message
news:Oe**************@TK2MSFTNGP10.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
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...
6
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...
4
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...
2
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...
3
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...
5
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...
2
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...
12
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...
4
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.