Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 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 September 9th, 2004, 11:40 AM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting apostrophes into an Access Dataabase

Hello,

I have a user form, which of course, takes-in user's info. If a user enters in apostrophe in the string, (i.e. Smith's Hardware) the application throws an error. However, if the user enters (Smiths Hardware) the string is inserted into the DB fine.

My question is how do I insert these apostrophes into my Database?

Thanks in advance,

MGR

 
Old September 9th, 2004, 04:20 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Using a replace method, such as:

Dim strText As String = "Smith's Hardware"
strSQL &= "... set Name = '" & strText.Replace("'", "''") & "', ...

Brian
 
Old September 10th, 2004, 05:57 AM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok Brian,

Thanks I will give it a try.

Mark






Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid truncating field values with apostrophes jrobbins ASP.NET 1.0 and 1.1 Professional 3 December 4th, 2007 08:24 PM
apostrophes or quotation marks crmpicco Javascript 6 March 21st, 2006 09:01 AM
Adding line feeds and apostrophes to a database RiffAff Classic ASP Professional 1 January 21st, 2006 05:40 PM
issues with apostrophes darkhalf Classic ASP Databases 3 December 22nd, 2004 02:42 AM





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