very weird access/ASP error

i have a memo field in an access database. the ASP page enters data to this
field just fine.... however the following test (dont ask):

Hello Charlie,

you have no idea who I am but I thought you should know that your wife has
been spending your mortgage money on things other than paying the bank. You
also don't know that she has been hiding the foreclosure letters from you
and its only a matter of time before you are kicked out of your home that
you spent so many years paying for. I cant tell you who I am as it will
cause much grief in the family, but I also cant watch as this goes on. If my
wife betrayed me like that I would want someone to tell me. Good luck!

produces this error:

Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression ''Hello Charlie, you
have no idea who I am but I thought you should know that your wife has been
spending your mortgage money on things other than paying the bank. You also
don't know that she has been hiding the foreclosure letters from you and its
on'.



whats going on here?
Jason Simmons [ Mi, 27 September 2006 22:52 ] [ ID #1480717 ]

Re: very weird access/ASP error

Joe Reynolds wrote:
> i have a memo field in an access database. the ASP page enters data
> to this field just fine.... however the following test (dont ask):
>
> Hello Charlie,
>
> you have no idea who I am but I thought you should know that your
> wife has been spending your mortgage money on things other than
> paying the bank. You also don't know that she has been hiding the
> foreclosure letters from you and its only a matter of time before you
> are kicked out of your home that you spent so many years paying for.
> I cant tell you who I am as it will cause much grief in the family,
> but I also cant watch as this goes on. If my wife betrayed me like
> that I would want someone to tell me. Good luck!
> produces this error:
>
> Microsoft JET Database Engine error '80040e14'
> Syntax error (missing operator) in query expression ''Hello Charlie,
> you have no idea who I am but I thought you should know that your
> wife has been spending your mortgage money on things other than
> paying the bank. You also don't know that she has been hiding the
> foreclosure letters from you and its on'.
>
>
>
> whats going on here?

Probably the apostrophe but that;s just a guess. How was this query
expression created?


--
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"
reb01501 [ Mi, 27 September 2006 23:17 ] [ ID #1480722 ]

Re: very weird access/ASP error

"Bob Barrows [MVP]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
news:%23viOIpn4GHA.2464 [at] TK2MSFTNGP06.phx.gbl...
> Joe Reynolds wrote:
>> i have a memo field in an access database. the ASP page enters data
>> to this field just fine.... however the following test (dont ask):
>>
>> Hello Charlie,
>>
>> you have no idea who I am but I thought you should know that your
>> wife has been spending your mortgage money on things other than
>> paying the bank. You also don't know that she has been hiding the
>> foreclosure letters from you and its only a matter of time before you
>> are kicked out of your home that you spent so many years paying for.
>> I cant tell you who I am as it will cause much grief in the family,
>> but I also cant watch as this goes on. If my wife betrayed me like
>> that I would want someone to tell me. Good luck!
>> produces this error:
>>
>> Microsoft JET Database Engine error '80040e14'
>> Syntax error (missing operator) in query expression ''Hello Charlie,
>> you have no idea who I am but I thought you should know that your
>> wife has been spending your mortgage money on things other than
>> paying the bank. You also don't know that she has been hiding the
>> foreclosure letters from you and its on'.
>>
>>
>>
>> whats going on here?
>
> Probably the apostrophe but that;s just a guess. How was this query
> expression created?
>
>
> --
> 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"
>
yup thats it. i take posted data from a text box and save it in a variable,
then pass the variable in the SQL string.
how can i fix this?
Jason Simmons [ Mi, 27 September 2006 23:54 ] [ ID #1480723 ]

Re: very weird access/ASP error

will this work?

http://wiki.ittoolbox.com/index.php/FAQ:How_do_I_escape_sing le_quotes_in_SQL_queries%3F

i tried it and it seems to work but i wanted your opinion


"Bob Barrows [MVP]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
news:%23viOIpn4GHA.2464 [at] TK2MSFTNGP06.phx.gbl...
> Joe Reynolds wrote:
>> i have a memo field in an access database. the ASP page enters data
>> to this field just fine.... however the following test (dont ask):
>>
>> Hello Charlie,
>>
>> you have no idea who I am but I thought you should know that your
>> wife has been spending your mortgage money on things other than
>> paying the bank. You also don't know that she has been hiding the
>> foreclosure letters from you and its only a matter of time before you
>> are kicked out of your home that you spent so many years paying for.
>> I cant tell you who I am as it will cause much grief in the family,
>> but I also cant watch as this goes on. If my wife betrayed me like
>> that I would want someone to tell me. Good luck!
>> produces this error:
>>
>> Microsoft JET Database Engine error '80040e14'
>> Syntax error (missing operator) in query expression ''Hello Charlie,
>> you have no idea who I am but I thought you should know that your
>> wife has been spending your mortgage money on things other than
>> paying the bank. You also don't know that she has been hiding the
>> foreclosure letters from you and its on'.
>>
>>
>>
>> whats going on here?
>
> Probably the apostrophe but that;s just a guess. How was this query
> expression created?
>
>
> --
> 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"
>
Jason Simmons [ Do, 28 September 2006 00:00 ] [ ID #1480724 ]

Re: very weird access/ASP error

My preference is to use parameters, thereby avoiding all these stupid
delimiter issues, and providing the bonus of preventing sql injection*:

See here for a better, more secure way to execute your queries by using
parameter markers:
http://groups-beta.google.com/group/microsoft.public.inetser ver.asp.db/msg/72e36562fee7804e

Personally, I prefer using stored procedures, or saved parameter queries
as
they are known in Access:

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

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1& selm=eHYxOyvaDHA.4020%40tk2msftngp13.phx.gbl

* http://mvp.unixwiz.net/techtips/sql-injection.html
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23



Joe Reynolds wrote:
> will this work?
>
> http://wiki.ittoolbox.com/index.php/FAQ:How_do_I_escape_sing le_quotes_in_SQL_queries%3F
>
> i tried it and it seems to work but i wanted your opinion
>
>
> "Bob Barrows [MVP]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
> news:%23viOIpn4GHA.2464 [at] TK2MSFTNGP06.phx.gbl...
>> Joe Reynolds wrote:
>>> i have a memo field in an access database. the ASP page enters data
>>> to this field just fine.... however the following test (dont ask):
>>>
>>> Hello Charlie,
>>>
>>> you have no idea who I am but I thought you should know that your
>>> wife has been spending your mortgage money on things other than
>>> paying the bank. You also don't know that she has been hiding the
>>> foreclosure letters from you and its only a matter of time before
>>> you are kicked out of your home that you spent so many years paying for.
>>> I cant tell you who I am as it will cause much grief in the family,
>>> but I also cant watch as this goes on. If my wife betrayed me like
>>> that I would want someone to tell me. Good luck!
>>> produces this error:
>>>
>>> Microsoft JET Database Engine error '80040e14'
>>> Syntax error (missing operator) in query expression ''Hello Charlie,
>>> you have no idea who I am but I thought you should know that your
>>> wife has been spending your mortgage money on things other than
>>> paying the bank. You also don't know that she has been hiding the
>>> foreclosure letters from you and its on'.
>>>
>>>
>>>
>>> whats going on here?
>>
>> Probably the apostrophe but that;s just a guess. How was this query
>> expression created?
>>
>>
>> --
>> 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"

--
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"
reb01501 [ Do, 28 September 2006 00:17 ] [ ID #1480725 ]

Re: very weird access/ASP error

I have two functions, writeNiceData and readNiceData.
In there i replace single quotes in the string to something like &sq;
Then just use them when writing and reading from.

Joe Reynolds wrote:
> "Bob Barrows [MVP]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
> news:%23viOIpn4GHA.2464 [at] TK2MSFTNGP06.phx.gbl...
> > Joe Reynolds wrote:
> >> i have a memo field in an access database. the ASP page enters data
> >> to this field just fine.... however the following test (dont ask):
> >>
> >> Hello Charlie,
> >>
> >> you have no idea who I am but I thought you should know that your
> >> wife has been spending your mortgage money on things other than
> >> paying the bank. You also don't know that she has been hiding the
> >> foreclosure letters from you and its only a matter of time before you
> >> are kicked out of your home that you spent so many years paying for.
> >> I cant tell you who I am as it will cause much grief in the family,
> >> but I also cant watch as this goes on. If my wife betrayed me like
> >> that I would want someone to tell me. Good luck!
> >> produces this error:
> >>
> >> Microsoft JET Database Engine error '80040e14'
> >> Syntax error (missing operator) in query expression ''Hello Charlie,
> >> you have no idea who I am but I thought you should know that your
> >> wife has been spending your mortgage money on things other than
> >> paying the bank. You also don't know that she has been hiding the
> >> foreclosure letters from you and its on'.
> >>
> >>
> >>
> >> whats going on here?
> >
> > Probably the apostrophe but that;s just a guess. How was this query
> > expression created?
> >
> >
> > --
> > 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"
> >
> yup thats it. i take posted data from a text box and save it in a variable,
> then pass the variable in the SQL string.
> how can i fix this?
digger440uk [ Fr, 29 September 2006 13:02 ] [ ID #1483496 ]
Webserver » microsoft.public.inetserver.asp.db » very weird access/ASP error

Vorheriges Thema: ASP session & AJAX
Nächstes Thema: connection string defined in a global.asa file