473,395 Members | 1,571 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,395 software developers and data experts.

Redirect with variable

I'm redirecting a value to a page called update.asp from somepage.asp

Recid = Request.QueryString("qryCategory")
Response.redirect "update.asp?" & Recid

So it shows like /update.asp?3
My question is how do i grab that value (3)
and then use it in a query.

Thanks
Jul 19 '05 #1
5 8234
Response.Redirect "update.asp?rec=" & Recid

then Request.QueryString("rec") to get the value
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"alexz" <al*****@hotmail.com> wrote in message
news:43**************************@posting.google.c om...
I'm redirecting a value to a page called update.asp from somepage.asp

Recid = Request.QueryString("qryCategory")
Response.redirect "update.asp?" & Recid

So it shows like /update.asp?3
My question is how do i grab that value (3)
and then use it in a query.

Thanks

Jul 19 '05 #2
you would need to put the "3" in a querystring. So the redirect should go
to:
update.asp?ID=3
then to get the value of ID in the next page, you would use
abc = request.querystring ("ID")

good luck
"alexz" <al*****@hotmail.com> wrote in message
news:43**************************@posting.google.c om...
I'm redirecting a value to a page called update.asp from somepage.asp

Recid = Request.QueryString("qryCategory")
Response.redirect "update.asp?" & Recid

So it shows like /update.asp?3
My question is how do i grab that value (3)
and then use it in a query.

Thanks

Jul 19 '05 #3
Rafael Chemtob wrote on 11 feb 2004 in
microsoft.public.inetserver.asp.general:
you would need to put the "3" in a querystring. So the redirect
should go to:
update.asp?ID=3
then to get the value of ID in the next page, you would use
abc = request.querystring ("ID")


It is the best way, but not "need"

update.asp?3

==========================

abc = request.querystring

gives as value for abc: 3
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4

Recid = Request.QueryString("qryCategory")
Response.redirect "update.asp?" & Recid

and then

StrRecid = Request.QueryString("rec")

works and i do get the value passed.
And the i get a new problem.

As a test i do have this working
rs.Source = "SELECT * FROM courseReg WHERE(((courseReg.CourseID)=3))"
line 24 rs.CursorLocation = 2
line 25 rs.LockType = 3
line 26 rs.Open()

But when i try

rs.Source = "SELECT * FROM courseReg WHERE (((courseReg.CourseID) = " &
StrRecid & ")) "
rs.CursorType = 0

Microsoft JET Database Engine error '80040e14'
Extra ) in query expression '(((courseReg.CourseID) = ))'.
update.asp, line 26

I know i pass the correct value i just don't understand
why this code giving problems.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5
Alex zurab wrote:

rs.Source = "SELECT * FROM courseReg WHERE (((courseReg.CourseID) = "
& StrRecid & ")) "
rs.CursorType = 0

Microsoft JET Database Engine error '80040e14'
Extra ) in query expression '(((courseReg.CourseID) = ))'.
update.asp, line 26

I know i pass the correct value i just don't understand
why this code giving problems.
It's pretty obvious that StrRecid does not contain what you think it
contains. And here is why: Recid = Request.QueryString("qryCategory")
Response.redirect "update.asp?" & Recid


You did not name the querystring variable in the redirect statement. It
should be:
Response.redirect "update.asp?rec=" & Recid
To help you better debug these things, never assign a concatenated string
directly to an object's property. Always assign it to a variable, and
subsequently use the variable in the code. This will allow you to write the
variable to the response to see what it contains. Like this (I'm getting rid
of those unneeded and confusing parentheses):

sSQL="SELECT * FROM courseReg WHERE courseReg.CourseID = "
sSQL = sSQL & StrRecid
'the following lines can be commented or deleted after debugging is done
'*******************************************
Response.Write sSQL
Response.End
'*******************************************
'it looks like you are opening a default cursor, so only one
'line is needed (you don't even need the "set rs=createobject" line):
set rs = conn.execute(sSQL,,1)

You only need to explicitly create and set the recordset's properties if you
need something other than the default, server-side, forward-only cursor.

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #6

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

Similar topics

6
by: Tim Stokes | last post by:
Hi all, I want to do a similar action to response.redirect ("file.htm"). But the file.htm contains some sensitive data. I have placed file.htm in a folder in the InetPub...
3
by: Bill | last post by:
I have a page that contains processed variables that I'd like to forward using the response.redirect method. However, because the response.redirect contains the page within "pagename.asp", I have...
5
by: Steve Lutz | last post by:
Hello, I have a page that creates a class, and then on certain conditions, redirects user to another page. The class has a Class_Terminate() function that saves itself to a database. The class...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
4
by: TomT | last post by:
Hi.. I'm redirecting users to another page using: response.redirect("newpage.asp") this works... But I need to add a variable to the page specified.. IE: newpage.asp?id=JobID
3
by: Peter Row | last post by:
Hi, I better get the background stuff out the way first, so here goes: - Porting a VB6 webclass app to VB.NET using HttpHandlers and FormsAuthentication - When someone visits my site...
6
by: Peter Row | last post by:
Hi, I am writing a DLL in VB.NET that implements IHttpHandler.ProcessRequest. This code calls a sub and I need to know if that sub did a response redirect or not. Specifically I need to know...
1
by: John | last post by:
Hi, I have a routine that sets some session variables and then redirects the user to another page in the same application/ same folder. ======= Session("MyName") = "Fredsmith"...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.