473,608 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2987
strMyQuery = Replace(Request .Form("txtSomeF ield"), "'", "")

Or

strMyQuery = Replace(Request .Form("txtSomeF ield"), "'", """)

--
Regards

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

Keeping it FREE!

"John" <no***@amIgivin gitouthere.com> wrote in message
news:2m******** ***********@twi ster.nyroc.rr.c om...
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("txtSomeF ield"), "'", "''")
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("txtSomeF ield"), "'", "")

Or

strMyQuery = Replace(Request .Form("txtSomeF ield"), "'", """)

--
Regards

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

Keeping it FREE!

"John" <no***@amIgivin gitouthere.com> wrote in message
news:2m******** ***********@twi ster.nyroc.rr.c om...
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******@NOyah oo.SPAMcom> wrote in message
news:##******** ******@TK2MSFTN GP12.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%40TK2MSFTNGP 12.phx.gblhttp://www.google.com/groups?hl=en&lr =&ie=UTF-8&oe=
UTF-8&threadm=3bc06 369.4904372%40n ews.charter.net &rnum=4&prev =/groups%3Fas_q
%3Ddelimiter%26 safe%3Dimages%2 6ie%3DUTF-8%26oe%3DUTF-8%26as_uauthors %3DBob%2
520Barrows%26lr %3D%26hl%3Denht tp://tinyurl.com/jyy0http://www.google.com/gro
ups?hl=en&lr=&i e=UTF-8&oe=UTF-8&threadm=O31NZ a%230DHA.3436%4 0tk2msftngp13.p h
x.gbl&rnum=11&p rev=/groups%3Fq%3Dde limiter%2Bautho r:Bob%2Bauthor: Barrows%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******** *****@TK2MSFTNG P12.phx.gbl:
Bob hehe, the URL is majorly invalid <vbg>

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

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:##******** ******@TK2MSFTN GP12.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%40TK2MSFTNGP 12.phx.gblhttp://www.google.com/groups?hl=en&lr =&ie=UTF-8
&oe=
UTF-8&threadm=3bc06 369.4904372%40n ews.charter.net &rnum=4&prev =/groups%3F
as_q
%3Ddelimiter%26 safe%3Dimages%2 6ie%3DUTF-8%26oe%3DUTF-8%26as_uauthors %3DB
ob%2
520Barrows%26lr %3D%26hl%3Denht tp://tinyurl.com/jyy0http://www.google.com
/gro
ups?hl=en&lr=&i e=UTF-8&oe=UTF-8&threadm=O31NZ a%230DHA.3436%4 0tk2msftngp1
3.ph
x.gbl&rnum=11&p rev=/groups%3Fq%3Dde limiter%2Bautho r:Bob%2Bauthor: Barrows
%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********@sbc global.net> wrote in message
news:Xn******** *************** *****@207.115.6 3.158...
Gazing into my crystal ball I observed "Steven Burn"
<so*******@in-time.invalid> writing in
news:#P******** *****@TK2MSFTNG P12.phx.gbl:
Bob hehe, the URL is majorly invalid <vbg>


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

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:##******** ******@TK2MSFTN GP12.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%40TK2MSFTNGP 12.phx.gblhttp://www.google.com/groups?hl=en&lr =&ie=UTF-8
&oe=
UTF-8&threadm=3bc06 369.4904372%40n ews.charter.net &rnum=4&prev =/groups%3F as_q
%3Ddelimiter%26 safe%3Dimages%2 6ie%3DUTF-8%26oe%3DUTF-8%26as_uauthors %3DB
ob%2
520Barrows%26lr %3D%26hl%3Denht tp://tinyurl.com/jyy0http://www.google.com
/gro
ups?hl=en&lr=&i e=UTF-8&oe=UTF-8&threadm=O31NZ a%230DHA.3436%4 0tk2msftngp1
3.ph
x.gbl&rnum=11&p rev=/groups%3Fq%3Dde limiter%2Bautho r:Bob%2Bauthor: Barrows
%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%2520Barr ows%26lr%3D%26h l%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
17192
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 oracle database. When i retrieve the data, some of the special characters have been changed to ??? and also
2
11506
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 page-design or even worse attacking my site with javascript directives i use stuff like (WebControls.Label)Output.Text = HttpUtility.HtmlEncode(userDefinedData); and my own functions which allow Line-Breaks and handle links. But that way seems not to be...
11
2773
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 < or several others, it converts them to html, such as &amp; or &lt; which can sometimes cause my scripts not to work. How can I prevent ASP.NET from doing this? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
7
3270
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 ∑ http://xahlee.org/
7
4901
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
1891
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 existing JavaScript array I don't have any problems, but I'm generating the arrays dynamically, then populating my dropdown dynamically with the onload event. I've tried setting multiple encodings in the meta tag with no success.
5
4160
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 points to a sqlserver2005 instance... it comes in looking like this in the debugger:
14
5753
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 entities, and French/German special characters are lost and/or replaced by a question mark. This is really frustrating. I have tried using StreamReader with ALL the encodings available and none work correctly. Each encoding handles some characters...
6
4418
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 characters like "ø, á, í, é, È, ž, ù, ý". But when I try to parse the particular record with these special characters using the method parse(), I got an error "not well-formed (invalid token)". Could anyone please help me out in solving this...
0
8013
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8503
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8488
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...
1
8164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8360
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
6831
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
6017
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
4039
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1613
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.