Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 22nd, 2006, 04:13 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
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.
Reply With Quote
  #2 (permalink)  
Old February 22nd, 2006, 04:39 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

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

Chris

Reply With Quote
  #3 (permalink)  
Old February 22nd, 2006, 01:17 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
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




Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 04:09 PM
Getting single and double quotes into DB hoffmann Classic ASP Databases 9 December 3rd, 2003 11:24 PM



All times are GMT -4. The time now is 01:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.