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 June 30th, 2003, 09:29 AM
Registered User
 
Join Date: Jun 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting "Double Quotes" ASP?VBScript/SQL Server

Hi all,
I have a form which inserts into an SQL Server varchar(1000) field from a textarea using ASP/VBScript.
When i insert text in double quotes from the text area, for example "Hello", it isnt inserted into the database. I'v been trying to solve this for a while with no luck. Can anyone point me in the right direction to solving this. Do you use Replace() to change the double quotes? If so how?
Thanks in advance
Craig
 
Old July 4th, 2003, 10:37 PM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Craig,

Here is my code, and I have no problem inserting double quote.
Note: I replace single quote with 2 single quotes to prevent SQL to truncate the statement

//form in page 1
<FORM METHOD="post" ACTION="Test2.asp">
   <TEXTAREA NAME="Description">"Hello"</TEXTAREA>
   <BR><INPUT TYPE="submit">
</FORM>

//action page
sSQL = "INSERT INTO tblTest (Description) VALUES ('" & Replace(sDesc, "'", "''") & "')"
Call cn.Execute(sSQL)

Is that what you doing?
Khoa Nguyen





Similar Threads
Thread Thread Starter Forum Replies Last Post
double quotes MyronCope Classic ASP Basics 2 November 21st, 2006 09:31 AM
displaying single quotes and double quotes ren_123 Classic ASP Databases 2 February 22nd, 2006 02:17 PM
Double Quotes langer123 Classic ASP Basics 2 March 16th, 2005 06:22 PM
Double Quotes and Single Quotes Problem phungleon Classic ASP Basics 7 May 27th, 2004 01:44 PM
Using quotes in VBSCript and an asp page dragonfields Classic ASP Basics 2 July 31st, 2003 10:30 AM





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