473,698 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Easy string problem: invalid syntax????

I get an incorrect syntax error pointing to the semicolon when I run
this sql statement with a dynamic querystring (geid is primary key
integer datatype):

sql="SELECT firstname,lastn ame from general where geid = " &
request.QuerySt ring("id") & ";"
...i've tried every possible combination, obviously breaking syntax
rules, and keep getting the error pointing to either the ; or the =

???????
netsports

Feb 8 '07 #1
9 2212

".Net Sports" <ba********@cox .netwrote in message
news:11******** **************@ p10g2000cwp.goo glegroups.com.. .
>I get an incorrect syntax error pointing to the semicolon when I run
this sql statement with a dynamic querystring (geid is primary key
integer datatype):

sql="SELECT firstname,lastn ame from general where geid = " &
request.QuerySt ring("id") & ";"
..i've tried every possible combination, obviously breaking syntax
rules, and keep getting the error pointing to either the ; or the =

???????
netsports
Have you established that Request.QuerySt ring("id") holds a valid value?
<%
sql="SELECT firstname,lastn ame from general where geid = " &
request.QuerySt ring("id") & ";"
Response.Write sql
Response.End
%>

--
Mike Brind
Feb 8 '07 #2
Pav
On Feb 8, 11:10 pm, ".Net Sports" <ballz2w...@cox .netwrote:
I get an incorrect syntax error pointing to the semicolon when I run
this sql statement with a dynamic querystring (geid is primary key
integer datatype):

sql="SELECT firstname,lastn ame from general where geid = " &
request.QuerySt ring("id") & ";"

..i've tried every possible combination, obviously breaking syntax
rules, and keep getting the error pointing to either the ; or the =

???????
netsports
Can you use it like this

Dim sID
sID=request.Que ryString("id")

sql="SELECT firstname,lastn ame from general where geid = ' "&sID&" '
". <Remove space between double quote and single quote>
Feb 8 '07 #3
Pav wrote on 08 feb 2007 in microsoft.publi c.inetserver.as p.general:
On Feb 8, 11:10 pm, ".Net Sports" <ballz2w...@cox .netwrote:
>I get an incorrect syntax error pointing to the semicolon when I run
this sql statement with a dynamic querystring (geid is primary key
integer datatype):

sql="SELECT firstname,lastn ame from general where geid = " &
request.QueryS tring("id") & ";"

..i've tried every possible combination, obviously breaking syntax
rules, and keep getting the error pointing to either the ; or the =

???????
netsports

Can you use it like this

Dim sID
sID=request.Que ryString("id")

sql="SELECT firstname,lastn ame from general where geid = ' "&sID&" '
". <Remove space between double quote and single quote>
.... and just when it works this is so VERY DANGEROUS,
as putting a request.QuerySt ring() value directly into a SQL string
without thorough validation, is inviting being severely hacked by sql-
injection, puting your whole database for the hacking world to duplicate,
change and destroy. And sometimes even to allow the hacker to insert a
shell command in the string and opening your HD drives to him.
[.. or her. Are there female hackers btw?]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 8 '07 #4
Why don't you just leave off the ; ?

Bob Lehmann

".Net Sports" <ba********@cox .netwrote in message
news:11******** **************@ p10g2000cwp.goo glegroups.com.. .
I get an incorrect syntax error pointing to the semicolon when I run
this sql statement with a dynamic querystring (geid is primary key
integer datatype):

sql="SELECT firstname,lastn ame from general where geid = " &
request.QuerySt ring("id") & ";"
..i've tried every possible combination, obviously breaking syntax
rules, and keep getting the error pointing to either the ; or the =

???????
netsports

Feb 9 '07 #5
"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
[.. or her. Are there female hackers btw?]
No. Only wives and girlfriends of hackers who can often be heard asking,
"When are you going to get off that
@#$% COMPUTER?"
--
Roland Hall
Feb 12 '07 #6
Roland Hall wrote on 12 feb 2007 in
"Evertjan." <ex************ **@interxnl.net wrote in message
>[.. or her. Are there female hackers btw?]

No. Only wives and girlfriends of hackers who can often be heard
asking, "When are you going to get off that
@#$% COMPUTER?"
Evidently from personal experience, Roland.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 12 '07 #7

"Roland Hall" <nobody@nowhere wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
>[.. or her. Are there female hackers btw?]

No. Only wives and girlfriends of hackers who can often be heard asking,
"When are you going to get off that
@#$% COMPUTER?"
Sorry. I do not believe that for one second.

There is absolutely NO WAY that any half decent hacker would leave their
computer long enough to expose themselves to the possibility of meeting
someone of the opposite sex.

You are mistaking hackers for developers, I reckon.
Feb 12 '07 #8
"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
Roland Hall wrote on 12 feb 2007 in
>"Evertjan." <ex************ **@interxnl.net wrote in message
>>[.. or her. Are there female hackers btw?]

No. Only wives and girlfriends of hackers who can often be heard
asking, "When are you going to get off that
@#$% COMPUTER?"

Evidently from personal experience, Roland.
Evidently, although my hat is gray! (O;=

--
Roland Hall
Feb 13 '07 #9
"Mike Brind" <du***@newsgrou ps.comwrote in message
news:u2******** ******@TK2MSFTN GP02.phx.gbl...
>
"Roland Hall" <nobody@nowhere wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******* *************@1 94.109.133.242. ..
>>[.. or her. Are there female hackers btw?]

No. Only wives and girlfriends of hackers who can often be heard asking,
"When are you going to get off that
@#$% COMPUTER?"

Sorry. I do not believe that for one second.

There is absolutely NO WAY that any half decent hacker would leave their
computer long enough to expose themselves to the possibility of meeting
someone of the opposite sex.

You are mistaking hackers for developers, I reckon.
Pr( * Y * )n & h3x1n g0 2g3th3r

--
Roland Hall
Feb 13 '07 #10

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

Similar topics

6
3496
by: Chris Connett | last post by:
I have an interesting problem with eval(). ---Background Info--- The program I'm working on launches a separate process with a popen to do some highly specialized processing of input, then this process leaves resultant data structured in files, in python syntax, at a known absolute path, which is then read in, eval()'ed, and processed further. It works fine when there are no errors in processing by this external program, but when there...
33
9164
by: Jim Hill | last post by:
I've done some Googling around on this and it seems like creating a here document is a bit tricky with Python. Trivial via triple-quoted strings if there's no need for variable interpolation but requiring a long, long formatted arglist via (%s,%s,%s,ad infinitum) if there is. So my question is: Is there a way to produce a very long multiline string of output with variables' values inserted without having to resort to this wacky """v...
108
6390
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would describe if applied to a sequence of length items. It returns a tuple of three integers; respectively these are the /start/ and /stop/ indices and the /step/ or stride length of the slice. Missing or out-of-bounds indices are handled in a manner...
3
2609
by: krzychu | last post by:
Hi, I have installed brand new platform - Zope-2-7-6, Python 2.4.1, Plone 2.0.5, OS Debian 1:3.3.6-2. After import a old Plone site from the following platform Zope-2-7-4, Python 2.3.3, Plone 2.0.3 to the new one, I get error when I visit PuthonScript in the ZMI. "invalid syntax (Script (Python), line 1)"
10
600
by: headware | last post by:
I know that you can call the method of one from from inside another form by doing something like this Forms("MyForm").MyFunction(12, 34) However, you have to know that MyForm has a function called MyFunction. Can you specify a string for the function name like you can with the form name? That is can I do something like Forms("MyForm")."MyFunction"
7
4358
by: al | last post by:
char s = "This string literal"; or char *s= "This string literal"; Both define a string literal. Both suppose to be read-only and not to be modified according to Standard. And both have type of "const char *". Right? But why does the compiler I am using allow s to be modified, instead of generating compile error?
1
3850
by: Aaron Queenan | last post by:
I have the following in the idl for a COM collection: HRESULT Item( VARIANT* Index, LPDISPATCH* punk); This allows VBA to access objects in the collection using the syntax collection("key") or collection(1). When I import this type library into C#, the DISPID_VALUE property appears as 'this', and when I try to use the syntax similar to VBA, the compiler
2
8088
by: Tom Larard | last post by:
Hi, We have an app which uses the latest version of perl DBI and DBD::Pg to execute a query, using placeholders. It fails to cast the float I send into a number and generates the following message "DBD::Pg::st execute failed: ERROR: invalid input syntax for integer: "2.63" at -e line 8." Here is a little test case:
20
2892
by: raylopez99 | last post by:
Inspired by Chapter 8 of Albahari's excellent C#3.0 in a Nutshell (this book is amazing, you must get it if you have to buy but one C# book) as well as Appendix A of Jon Skeet's book, I am going through some LINQ queries. But how to cast? ( See the below, modified from somebody else's code. The problem is the query 'stops' (throws a cast exception) at "3", and never gets to "violet".
0
9029
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8867
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7732
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4370
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
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 we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.