Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: query problem...syntax error


Message #1 by omkarj@h... on Wed, 8 Jan 2003 10:30:34
Hi,
Am trying to save data from the form to database.

The query is,

sql= "insert into weekly values ('"+t1+"','"+t2+"','"+t3+"','"+t4+"')"

where t1,t2 etc. are the variables which store values from the 
request.form.item

Now, if the user inserts a value like  xyz  the query works fine.

But, if the value is like xy'z    it gives syntax error


help me,

Thanks.
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 9 Jan 2003 11:23:55 +1100
http://www.adopenstatic.com/faq/80040e14.asp#scenario3a

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <omkarj@h...>
Subject: [access_asp] query problem...syntax error


: Hi,
: Am trying to save data from the form to database.
:
: The query is,
:
: sql= "insert into weekly values ('"+t1+"','"+t2+"','"+t3+"','"+t4+"')"
:
: where t1,t2 etc. are the variables which store values from the
: request.form.item
:
: Now, if the user inserts a value like  xyz  the query works fine.
:
: But, if the value is like xy'z    it gives syntax error
:
:
: help me,
:
: Thanks.

Message #3 by omkarj@h... on Thu, 9 Jan 2003 05:25:25
thanks Ken

 it works.


> http://www.adopenstatic.com/faq/80040e14.asp#scenario3a

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <omkarj@h...>
Subject: [access_asp] query problem...syntax error


: Hi,
: Am trying to save data from the form to database.
:
: The query is,
:
: sql= "insert into weekly values ('"+t1+"','"+t2+"','"+t3+"','"+t4+"')"
:
: where t1,t2 etc. are the variables which store values from the
: request.form.item
:
: Now, if the user inserts a value like  xyz  the query works fine.
:
: But, if the value is like xy'z    it gives syntax error
:
:
: help me,
:
: Thanks.


  Return to Index