473,511 Members | 15,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What's wrong?

Oli
Hi

URL in address bar:
http://localhost/edituser.asp?pID=1

SQLQuery = "SELECT * from Applicant WHERE pID="' & Request.Querysting('pID')
& '"

But it only gets: SELECT * from Applicant WHERE pID=

This is only simple but is causing me a headache!

Any ideas??
TIA - Oli
Jul 19 '05 #1
7 1834
You've miss spelt querystring as querysting.

To avoid this problem you can just refer to it like:

request('pID')

Its also handy because you can use it to locate a variable anywhere, be it
in the querystring or on a form thats submitted.

"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@sparta.btinternet.com...
Hi

URL in address bar:
http://localhost/edituser.asp?pID=1

SQLQuery = "SELECT * from Applicant WHERE pID="' & Request.Querysting('pID') & '"

But it only gets: SELECT * from Applicant WHERE pID=

This is only simple but is causing me a headache!

Any ideas??
TIA - Oli

Jul 19 '05 #2
Oli wrote:
Hi

URL in address bar:
http://localhost/edituser.asp?pID=1

SQLQuery = "SELECT * from Applicant WHERE pID="' &
Request.Querysting('pID') & '"

But it only gets: SELECT * from Applicant WHERE pID=

This is only simple but is causing me a headache!

Any ideas??
TIA - Oli


Nope. Show us some more of the script. Actually, you should create a test
page with just the following code in it:

<%
dim parm
parm = Request.Querystring("pID")
Response.Write "parm contains " & parm
Response.End
%>

Run the page, adding the querystring to the url, and let us know if you
don't get the intended result. If you do get the intended result, start
adding code from your current page until it stops working. If that does not
clue you into the problem, show us the code that breaks the page.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #3
stewert gallington wrote:
You've miss spelt querystring as querysting.
Good eye! I missed that. (obviously)
<grin> Of course, you realize that you misspelt "misspelt" ... ;-)

To avoid this problem you can just refer to it like:

request('pID')

Its also handy because you can use it to locate a variable anywhere,
be it in the querystring or on a form thats submitted.


But it can also cause problems:
1) Performance is impacted because several collections (including the
servervariables collection - a real performance hit) may have to be searched
to find the requested variable
2) You may get the wrong value if your variable name matches one of the
variable names in another collection. Try getting the result of
http://...?url=test by using request("url")

Our recommendation is to always specify the collection you wish to retrieve
the variable value from.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #4
In addition to the other comments, I've always used quotes around the item.
You have apostrophes. I'm not sure if it makes a difference, I've never
tried.

"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@sparta.btinternet.com...
Hi

URL in address bar:
http://localhost/edituser.asp?pID=1

SQLQuery = "SELECT * from Applicant WHERE pID="' & Request.Querysting('pID') & '"

But it only gets: SELECT * from Applicant WHERE pID=

This is only simple but is causing me a headache!

Any ideas??
TIA - Oli

Jul 19 '05 #5
> In addition to the other comments, I've always used quotes around the
item.
You have apostrophes. I'm not sure if it makes a difference, I've never
tried.


Yes, you should get:

Microsoft VBScript compilation error '800a03ea'
Syntax error

In any case, the reason Oli is getting a blank querystring is because the
delimiters are all jumbled (spaces added for legibility). The first ' acts
as a comment, so the rest of the line (after pID=) is ignored.

"... WHERE pID= " ' & Request.Querysting('pID') & ' "

Should be (note the differences in quotes and apostrophes):

"... WHERE pID= ' " & Request.Querysting("pID") & " ' "
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

Jul 19 '05 #6
If I had copied it into my editor, it would have turned green and I would
have noticed that.

Good eye Aaron.

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ON**************@TK2MSFTNGP11.phx.gbl...
In addition to the other comments, I've always used quotes around the item.
You have apostrophes. I'm not sure if it makes a difference, I've never
tried.


Yes, you should get:

Microsoft VBScript compilation error '800a03ea'
Syntax error

In any case, the reason Oli is getting a blank querystring is because the
delimiters are all jumbled (spaces added for legibility). The first '

acts as a comment, so the rest of the line (after pID=) is ignored.

"... WHERE pID= " ' & Request.Querysting('pID') & ' "

Should be (note the differences in quotes and apostrophes):

"... WHERE pID= ' " & Request.Querysting("pID") & " ' "
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

Jul 19 '05 #7
Dear sir,
correct the sqlquery as follows
1). single qoute should come within double qoute
2). As an expert said spelling mistake in Querystring

SQLQuery = "SELECT * from Applicant WHERE pID='" &
Request.Querystring('pID') &"'"

or

SQLQuery = "SELECT * from Applicant WHERE pID=" &
Request.Querystring('pID')
I hope this will work.
-----Original Message-----
Hi

URL in address bar:
http://localhost/edituser.asp?pID=1

SQLQuery = "SELECT * from Applicant WHERE pID="' & Request.Querysting('pID')& '"

But it only gets: SELECT * from Applicant WHERE pID=

This is only simple but is causing me a headache!

Any ideas??
TIA - Oli
.

Jul 19 '05 #8

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

Similar topics

125
14543
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
5
2819
by: titan0111 | last post by:
#include<iostream> #include<iomanip> #include<cstring> #include<fstream> using namespace std; class snowfall { private: int ft;
72
5737
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
121
9908
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
28
3234
by: Madhur | last post by:
Hello what about this nice way to open a file in single line rather than using if and else. #include<stdio.h> void main() { FILE *nd; clrscr();...
56
4271
by: Cherrish Vaidiyan | last post by:
Frinds, Hope everyone is doing fine.i feel pointers to be the most toughest part in C. i have just completed learning pointers & arrays related portions. I need to attend technical interview on...
46
4156
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do...
13
5001
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
9
2110
by: Pyenos | last post by:
import cPickle, shelve could someone tell me what things are wrong with my code? class progress: PROGRESS_TABLE_ACTIONS= DEFAULT_PROGRESS_DATA_FILE="progress_data" PROGRESS_OUTCOMES=
3
2135
by: Siong.Ong | last post by:
Dear all, my PHP aims to update a MySQL database by selecting record one by one and modify then save. Here are my PHP, but I found that it doesnt work as it supposed to be, for example, when...
0
7252
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
7432
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
7517
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...
1
5077
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...
0
3230
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
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...

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.