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 June 30th, 2003, 09:29 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old July 4th, 2003, 10:37 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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
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
double quotes MyronCope Classic ASP Basics 2 November 21st, 2006 08:31 AM
displaying single quotes and double quotes ren_123 Classic ASP Databases 2 February 22nd, 2006 01:17 PM
Double Quotes langer123 Classic ASP Basics 2 March 16th, 2005 05: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



All times are GMT -4. The time now is 07:06 AM.


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