Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2006, 05:13 AM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default displaying single quotes and double quotes

I am using ASP with MS Access. I store "orange" in database table. Now when i retrive this value and show it on page, it works fine.

    When i retirve this value and show in text box it display fine.

     i using <input type=text value='<%=querystring%>'>. But when i need to display 'apple',it cannot work. Please give me a solution to include both double quote and single quote.

    How can i display full value in text box.
 
Old February 22nd, 2006, 05:39 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

One way is...
Code:
<input type=text value="<%=Server.HTMLEncode(querystring)%>">
HTH,

Chris

 
Old February 22nd, 2006, 02:17 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

I'm not a 100% sure about Access but for MS-SQL you can use this on the insert. You may have to use this in conjunction with Chris' solution.

Replace([text value],"'","''")

This ends up writing only one single quote into the table cell.

This:

INSERT INTO Table1 (TheVar) VALUES ('This is the single ''apple'' and double "quotes" test')

Actual data in the table cell:

This is the single 'apple' and double "quotes" test









Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help! i hate...double and single quotes... keita Classic ASP Basics 3 March 28th, 2007 11:12 AM
Please explain single and double quotes rsgracey BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 4 June 8th, 2006 07:20 PM
Double Quotes and Single Quotes Problem phungleon Classic ASP Basics 7 May 27th, 2004 01:44 PM
Storing single and double quotes in text roniestein Access 4 December 30th, 2003 05:09 PM
Getting single and double quotes into DB hoffmann Classic ASP Databases 9 December 4th, 2003 12:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.