inserting quotes

inserting quotes

am 11.01.2006 14:28:43 von Gonzosez

I am inserting data into an access database.
The problem is that quotes in the field terminiate the string.
If the input value is
24" plug
all I get in the database is
24
How can I fix this?

Re: inserting quotes

am 11.01.2006 14:51:37 von josephweiss

I think this link may help...

http://www.aspfaq.com/show.asp?id=2035

Re: inserting quotes

am 11.01.2006 16:04:39 von reb01501

Gonzosez wrote:
> I am inserting data into an access database.
> The problem is that quotes in the field terminiate the string.
> If the input value is
> 24" plug
> all I get in the database is
> 24
> How can I fix this?
My best recommendation is to stop using dynamic sql. If you use parameters,
you don't have to worry about quotes, apostrophes and sql injection. See
http://groups-beta.google.com/group/microsoft.public.inetser ver.asp.db/msg/72e36562fee7804e
for one method.

Better yet, use saved parameter queries as described in these posts:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1& selm=eHYxOyvaDHA.4020%40tk2msftngp13.phx.gbl

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1& selm=ukS%246S%247CHA.2464%40TK2MSFTNGP11.phx.gbl

http://www.google.com/groups?selm=eETTdnvFDHA.1660%40TK2MSFT NGP10.phx.gbl&oe=UTF-8&output=gplain

http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&sel m=e6lLVvOcDHA.1204%40TK2MSFTNGP12.phx.gbl

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.