Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: RE: my recordset is returning value with a single quote


Message #1 by "TomMallard" <mallard@s...> on Tue, 1 Oct 2002 05:54:49 -0700
I've used this for inserting quotes into a db...

replace(strContent, "'", "''")

tom mallard
seattle

-----Original Message-----
From: Anthony Delcy [mailto:DELCYAN@w...]
Sent: Monday, September 30, 2002 9:10 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: my recordset is returning value with a
single quote


Scott,

The value could be something like the following:

 - Test's purposes
 - Pile's results

Etc..

Thank you

Anthony

>>> scott@s... 09/30/02 12:06 >>>
Anthony,
Can you give an example of the value of trsXML("TITLE")?
Scott



-----Original Message-----
From: delcyan@w... [mailto:delcyan@w...]
Sent: Monday, September 30, 2002 5:06 PM
To: ASP Web HowTo
Subject: [asp_web_howto] my recordset is returning value with a single
quote

Hello,

I would like to know how do I take care of return values from my
database
with single quote.

I have an ASP page which returns a title and that title could have a
single quote in it. rsXML("TITLE") is what I am using to build my return

page. Here is my code:

strHTML = strHTML & "<input class=""editfld "" maxlength=""40""
size=""80"" id=""title"" name=""title"" value='" & rsXML("GTR_TITLE") &
"'
readOnly>"


Thank you

Anthony

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20




---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


Message #2 by "Anthony Delcy" <DELCYAN@w...> on Tue, 01 Oct 2002 09:04:49 -0400
Tom,

The problem is not inserting in the database but when getting it from the 
database. What I do is as follow:

- I insert the title in the db
- then I want to get it back so I can display it.
- in my ASP page, I create a string of HTML concatenating with the asp 
values (From the db).
- The following is where I have a problem:

strHTML =3D strHTML & "<input class=3D""editfld "" maxlength=3D""40""
size=3D""80"" id=3D""title"" name=3D""title"" value=3D'" & rsXML("TITLE") 
&
"'
readOnly>"

At the end of my string build, I will write "strHTML " variable back to 
the client.

This is where the problem occurs: value=3D'" & rsXML("TITLE") & "'

If the Title is consist of a quote, it closes the value single quote and 
therefore I do not see the whatever text in my Title after the quote.

What I did now is replace the quotes with chr(96) which gives me something 
close to a quote.

Thank you

Anthony



>>> mallard@s... 10/01/02 08:54 >>>
I've used this for inserting quotes into a db...

replace(strContent, "'", "''")

tom mallard
seattle

-----Original Message-----
From: Anthony Delcy [mailto:DELCYAN@w...]
Sent: Monday, September 30, 2002 9:10 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: my recordset is returning value with a
single quote


Scott,

The value could be something like the following:

 - Test's purposes
 - Pile's results

Etc..

Thank you

Anthony

>>> scott@s... 09/30/02 12:06 >>>
Anthony,
Can you give an example of the value of trsXML("TITLE")?
Scott



-----Original Message-----
From: delcyan@w... [mailto:delcyan@w...]
Sent: Monday, September 30, 2002 5:06 PM
To: ASP Web HowTo
Subject: [asp_web_howto] my recordset is returning value with a single
quote

Hello,

I would like to know how do I take care of return values from my
database
with single quote.

I have an ASP page which returns a title and that title could have a
single quote in it. rsXML("TITLE") is what I am using to build my return

page. Here is my code:

strHTML =3D strHTML & "<input class=3D""editfld "" maxlength=3D""40""
size=3D""80"" id=3D""title"" name=3D""title"" value=3D'" & rsXML("GTR_TITLE
") &
"'
readOnly>"


Thank you

Anthony

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramme

r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramme

r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramme

r-20




---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramme

r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramme

r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramme

r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramme

r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramme

r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramme

r-20




---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramme

r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramme

r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramme

r-20
to unsubscribe send a blank email to leave-asp_web_howto-1319541V@p...
com.
Message #3 by Imar Spaanjaars <Imar@S...> on Tue, 01 Oct 2002 15:11:00 +0200
Hi there,

You can use Server.HTMLEncode to encode your string to HTML equivalents, 
like &quot; for a ".

Try this:

Server.HTMLEncode(rsXML("TITLE"))

HtH

Imar


At 09:04 AM 10/1/2002 -0400, you wrote:
>Tom,
>
>The problem is not inserting in the database but when getting it from the 
>database. What I do is as follow:
>
>- I insert the title in the db
>- then I want to get it back so I can display it.
>- in my ASP page, I create a string of HTML concatenating with the asp 
>values (From the db).
>- The following is where I have a problem:
>
>strHTML = strHTML & "<input class=""editfld "" maxlength=""40""
>size=""80"" id=""title"" name=""title"" value='" & rsXML("TITLE") &
>"'
>readOnly>"
>
>At the end of my string build, I will write "strHTML " variable back to 
>the client.
>
>This is where the problem occurs: value='" & rsXML("TITLE") & "'
>
>If the Title is consist of a quote, it closes the value single quote and 
>therefore I do not see the whatever text in my Title after the quote.
>
>What I did now is replace the quotes with chr(96) which gives me something 
>close to a quote.
>
>Thank you
>
>Anthony



  Return to Index