473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

html special characters and database problems, arg!

I am having problems with special characters with database calls (if I'm
referring to this in the right way). the problem is with apostrophes of all
things. If an end user puts an apostrophe in something ASP will interprete
it as a delimiter. This is aggravating because I'm trying to make this as
simple for the end user as possible and if they can't place something in a
simple text field like "Joe's Bar" (which comes out as "Joe") then I have a
problem because I don't have a solution for this. It appears that this "
´ " is not quite the same as " ' " and I don't see a special
character for apostrophes either.

This seems like a real pain in kee for something as small as this but it
confuses end users to not be able to write simple english.
Jul 22 '05 #1
7 2973
strMyQuery = Replace(Request.Form("txtSomeField"), "'", "")

Or

strMyQuery = Replace(Request.Form("txtSomeField"), "'", """)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"John" <no***@amIgivingitouthere.com> wrote in message
news:2m*******************@twister.nyroc.rr.com...
I am having problems with special characters with database calls (if I'm
referring to this in the right way). the problem is with apostrophes of all things. If an end user puts an apostrophe in something ASP will interprete it as a delimiter. This is aggravating because I'm trying to make this as
simple for the end user as possible and if they can't place something in a
simple text field like "Joe's Bar" (which comes out as "Joe") then I have a problem because I don't have a solution for this. It appears that this "
&acute; " is not quite the same as " ' " and I don't see a special
character for apostrophes either.

This seems like a real pain in kee for something as small as this but it
confuses end users to not be able to write simple english.

Jul 22 '05 #2
Or
strMyQuery = Replace(Request.Form("txtSomeField"), "'", "''")
will keep the apostrophe in the string...

Or, best yet, use parameterized queries through the ADODB.Command object...

http://www.4guysfromrolla.com/webtech/021799-1.shtml
http://www.4guysfromrolla.com/webtech/111798-1.shtml
http://www.allfreetech.com/ShowMain.asp?MainID=108&p=1
Steven Burn wrote:
strMyQuery = Replace(Request.Form("txtSomeField"), "'", "")

Or

strMyQuery = Replace(Request.Form("txtSomeField"), "'", """)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"John" <no***@amIgivingitouthere.com> wrote in message
news:2m*******************@twister.nyroc.rr.com...
I am having problems with special characters with database calls (if I'm
referring to this in the right way). the problem is with apostrophes of


all
things. If an end user puts an apostrophe in something ASP will


interprete
it as a delimiter. This is aggravating because I'm trying to make this as
simple for the end user as possible and if they can't place something in a
simple text field like "Joe's Bar" (which comes out as "Joe") then I have


a
problem because I don't have a solution for this. It appears that this "
&acute; " is not quite the same as " ' " and I don't see a special
character for apostrophes either.

This seems like a real pain in kee for something as small as this but it
confuses end users to not be able to write simple english.

Jul 22 '05 #3
John wrote:
I am having problems with special characters with database calls (if
I'm referring to this in the right way). the problem is with
apostrophes of all things. If an end user puts an apostrophe in
something ASP will interprete it as a delimiter. This is aggravating
because I'm trying to make this as simple for the end user as
possible and if they can't place something in a simple text field
like "Joe's Bar" (which comes out as "Joe") then I have a problem
because I don't have a solution for this. It appears that this "
&acute; " is not quite the same as " ' " and I don't see a
special character for apostrophes either.

This seems like a real pain in kee for something as small as this but
it confuses end users to not be able to write simple english.


Yes. Delimiters are a pain, aren't they? That's why I think it is a crime
that newbies are taught the wrong way (dynamic sql) before the right way
(stored procedures, passing parameters). You did not tell us what database
you are using so:

http://www.google.com/groups?hl=en&l...10%26sa%3DNBob Barrows--Microsoft MVP - ASP/ASP.NETPlease reply to the newsgroup. This email account is my spam trap so Idon't check it very often. If you must reply off-line, then remove the"NO SPAM"

Jul 22 '05 #4
Bob hehe, the URL is majorly invalid <vbg>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:##**************@TK2MSFTNGP12.phx.gbl...
John wrote:
I am having problems with special characters with database calls (if
I'm referring to this in the right way). the problem is with
apostrophes of all things. If an end user puts an apostrophe in
something ASP will interprete it as a delimiter. This is aggravating
because I'm trying to make this as simple for the end user as
possible and if they can't place something in a simple text field
like "Joe's Bar" (which comes out as "Joe") then I have a problem
because I don't have a solution for this. It appears that this "
&acute; " is not quite the same as " ' " and I don't see a
special character for apostrophes either.

This seems like a real pain in kee for something as small as this but
it confuses end users to not be able to write simple english.
Yes. Delimiters are a pain, aren't they? That's why I think it is a crime
that newbies are taught the wrong way (dynamic sql) before the right way
(stored procedures, passing parameters). You did not tell us what database
you are using so:

http://www.google.com/groups?hl=en&l...e6lLVvOcDHA.12
04%40TK2MSFTNGP12.phx.gblhttp://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=
UTF-8&threadm=3bc06369.4904372%40news.charter.net&rnum =4&prev=/groups%3Fas_q
%3Ddelimiter%26safe%3Dimages%26ie%3DUTF-8%26oe%3DUTF-8%26as_uauthors%3DBob%2
520Barrows%26lr%3D%26hl%3Denhttp://tinyurl.com/jyy0http://www.google.com/gro
ups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=O31NZa%230DHA.3436%40tk2msftngp13.ph
x.gbl&rnum=11&prev=/groups%3Fq%3Ddelimiter%2Bauthor:Bob%2Bauthor:Barro ws%26h
l%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26start%3D10%26sa%3DNBob
Barrows--Microsoft MVP - ASP/ASP.NETPlease reply to the newsgroup. This
email account is my spam trap so Idon't check it very often. If you must
reply off-line, then remove the"NO SPAM"

Jul 22 '05 #5
Gazing into my crystal ball I observed "Steven Burn"
<so*******@in-time.invalid> writing in
news:#P*************@TK2MSFTNGP12.phx.gbl:
Bob hehe, the URL is majorly invalid <vbg>

But the Tiny URL is - http://tinyurl.com/jyy0

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:##**************@TK2MSFTNGP12.phx.gbl...
John wrote:
> I am having problems with special characters with database calls (if
> I'm referring to this in the right way). the problem is with
> apostrophes of all things. If an end user puts an apostrophe in
> something ASP will interprete it as a delimiter. This is
> aggravating because I'm trying to make this as simple for the end
> user as possible and if they can't place something in a simple text
> field like "Joe's Bar" (which comes out as "Joe") then I have a
> problem because I don't have a solution for this. It appears that
> this " &acute; " is not quite the same as " ' " and I don't see
> a special character for apostrophes either.
>
> This seems like a real pain in kee for something as small as this
> but it confuses end users to not be able to write simple english.


Yes. Delimiters are a pain, aren't they? That's why I think it is a
crime that newbies are taught the wrong way (dynamic sql) before the
right way (stored procedures, passing parameters). You did not tell us
what database you are using so:

http://www.google.com/groups?hl=en&l...elm=e6lLVvOcDH
A.12
04%40TK2MSFTNGP12.phx.gblhttp://www.google.com/groups?hl=en&lr=&ie=UTF-8
&oe=
UTF-8&threadm=3bc06369.4904372%40news.charter.net&rnum =4&prev=/groups%3F
as_q
%3Ddelimiter%26safe%3Dimages%26ie%3DUTF-8%26oe%3DUTF-8%26as_uauthors%3DB
ob%2
520Barrows%26lr%3D%26hl%3Denhttp://tinyurl.com/jyy0http://www.google.com
/gro
ups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=O31NZa%230DHA.3436%40tk2msftngp1
3.ph
x.gbl&rnum=11&prev=/groups%3Fq%3Ddelimiter%2Bauthor:Bob%2Bauthor:Barro ws
%26h l%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26start%3D10%26sa%3DNBob
Barrows--Microsoft MVP - ASP/ASP.NETPlease reply to the newsgroup. This
email account is my spam trap so Idon't check it very often. If you
must reply off-line, then remove the"NO SPAM"



--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #6
<g> that'll work too .... cheers ;o)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Adrienne" <ar********@sbcglobal.net> wrote in message
news:Xn****************************@207.115.63.158 ...
Gazing into my crystal ball I observed "Steven Burn"
<so*******@in-time.invalid> writing in
news:#P*************@TK2MSFTNGP12.phx.gbl:
Bob hehe, the URL is majorly invalid <vbg>


But the Tiny URL is - http://tinyurl.com/jyy0

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:##**************@TK2MSFTNGP12.phx.gbl...
John wrote:
> I am having problems with special characters with database calls (if
> I'm referring to this in the right way). the problem is with
> apostrophes of all things. If an end user puts an apostrophe in
> something ASP will interprete it as a delimiter. This is
> aggravating because I'm trying to make this as simple for the end
> user as possible and if they can't place something in a simple text
> field like "Joe's Bar" (which comes out as "Joe") then I have a
> problem because I don't have a solution for this. It appears that
> this " &acute; " is not quite the same as " ' " and I don't see
> a special character for apostrophes either.
>
> This seems like a real pain in kee for something as small as this
> but it confuses end users to not be able to write simple english.

Yes. Delimiters are a pain, aren't they? That's why I think it is a
crime that newbies are taught the wrong way (dynamic sql) before the
right way (stored procedures, passing parameters). You did not tell us
what database you are using so:

http://www.google.com/groups?hl=en&l...elm=e6lLVvOcDH
A.12
04%40TK2MSFTNGP12.phx.gblhttp://www.google.com/groups?hl=en&lr=&ie=UTF-8
&oe=
UTF-8&threadm=3bc06369.4904372%40news.charter.net&rnum =4&prev=/groups%3F as_q
%3Ddelimiter%26safe%3Dimages%26ie%3DUTF-8%26oe%3DUTF-8%26as_uauthors%3DB
ob%2
520Barrows%26lr%3D%26hl%3Denhttp://tinyurl.com/jyy0http://www.google.com
/gro
ups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=O31NZa%230DHA.3436%40tk2msftngp1
3.ph
x.gbl&rnum=11&prev=/groups%3Fq%3Ddelimiter%2Bauthor:Bob%2Bauthor:Barro ws
%26h l%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26start%3D10%26sa%3DNBob
Barrows--Microsoft MVP - ASP/ASP.NETPlease reply to the newsgroup. This
email account is my spam trap so Idon't check it very often. If you
must reply off-line, then remove the"NO SPAM"



--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jul 22 '05 #7
Bob Barrows [MVP] wrote:
John wrote:
I am having problems with special characters with database calls (if
I'm referring to this in the right way). the problem is with
apostrophes of all things. If an end user puts an apostrophe in
something ASP will interprete it as a delimiter. This is aggravating
because I'm trying to make this as simple for the end user as
possible and if they can't place something in a simple text field
like "Joe's Bar" (which comes out as "Joe") then I have a problem
because I don't have a solution for this. It appears that this "
&acute; " is not quite the same as " ' " and I don't see a
special character for apostrophes either.

This seems like a real pain in kee for something as small as this but
it confuses end users to not be able to write simple english.


Yes. Delimiters are a pain, aren't they? That's why I think it is a
crime
that newbies are taught the wrong way (dynamic sql) before the right
way (stored procedures, passing parameters). You did not tell us what
database
you are using so:

http://www.google.com/groups?hl=en&l...10%26sa%3DNBob
I do not understand what happened to the line breaks. Let's try again:

http://www.google.com/groups?hl=en&l...TNGP12.phx.gbl

http://www.google.com/groups?hl=en&l...r%26safe%3Dima
ges%26ie%3DUTF-8%26oe%3DUTF-8%26as_uauthors%3DBob%2520Barrows%26lr%3D%26hl%3
Den

http://tinyurl.com/jyy0

http://www.google.com/groups?hl=en&l...%3D10%26sa%3DN
--
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.
Jul 22 '05 #8

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

Similar topics

3
by: Barry Olly | last post by:
Hi, I'm working on a mini content management system and need help with dealing with special characters. The input are taken from html form which are then stored into a varchar column in...
2
by: ViperDK | last post by:
What is the best way for that? I store all Data in the original form in the Database. To prevent output fields (especially the fields everyone can use) to do bad things like killing the...
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
7
by: Xah Lee | last post by:
Summary: when encountering ex as a unit in css, FireFox (and iCab) did not take into account the font-family. Detail: http://xahlee.org/js/ff_pre_ex.html Xah xah@xahlee.org ∑...
7
by: Trac Bannon | last post by:
When I load XML from a file into a dotNet XMLDataDocument, the UTF-8 codes are resolved but the 5 special XML entities are not. How can I force those 5 special character types to be translated?
1
by: jeffejohnson | last post by:
I'm looking to see if anyone has experienced this... I've got a dropdown that I'm populating dynamically and the items include HTML special characters (like &Ocirc;). If I load them from an...
5
by: Alex | last post by:
Hi all - Is there a standard way to handle special chars in strings in dotnet? I'm using csharp and having two seperate problems... 1. Passing in args... I need to pass in an arg that...
14
by: Zoro | last post by:
My task is to read html files from disk and save them onto SQL Server database field. I have created an nvarchar(max) field to hold them. The problem is that some characters, particularly html...
6
by: rellaboyina | last post by:
Dear All, I am having some data which will be stored in XML format and this needs to be parsed using the parser module XML::Parser and XML::Parser::Expat. This data consists of some special...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.