Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass double quotes(") from DB to ASP page

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need to catch values in the DB and display them to the users to edit. But when ASP encouters double quotes ("), it terminates. Instead of displaying 2" X 2", it displaying only 2 to the users. I need to have a function which will:
1. Find out if a string contains ". The function
InStr(string, """) > 0 won't work. Any other way to
do the same function?
2. Show the whole string 2" X 2" in the ASP page.

Can anyone help me?

Thanks
 
If you want to be able to see double quotes on ASP/HTML page then replace all single quotes inside strings with this code ' and double quotes with , then browser will correctly display them. ---
---
 
uladzik, thank you very much for your help.

It seems there is no problem for the ASP/HTML page to pass " to the database. But when I want the database to pass " to the ASP/HTML page, the problem occurs. Let's say 2" X 2" is stored in a column named PictureSize. Then I open the database with a recordset object rs and assign the column value to a variable named size:
size = rs("PictureSize")
In this case, only 2 (instead of 2" X 2") is in size.

I think I can convert " to another character (like $) before storing it in the database, and then reconvert it before displaying it to users. But I wonder if we have the way to just store and display " without any conversion.

Again, thank you.
 
Put two " in your database, or use a single quote. They never have to knock if your door is always open.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top