Solved

' and Access

Posted on 2002-07-17
8
159 Views
Last Modified: 2012-05-04
When I take a string from a text box.. and that string has a ' in it.. it won't store into the DB and throw me an error!

What can I do with this?
0
Comment
Question by:nfuids
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 25 total points
ID: 7160835
Use:
sText = Replace(sText, "'", "''")

Anthony
0
 

Expert Comment

by:kuist
ID: 7160930
'' will be accepted by Access as a ' ?

like if I enter somethink like:


what's your best ...


when I would retreive it from ACCESS and put it in a label's caption, it would be " what's your best ... " ?

0
 

Author Comment

by:nfuids
ID: 7165868
hello?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:nfuids
ID: 7165873
yeah, kuist is right, I don't think making ' -> '' would do the job!
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7166022
>>yeah, kuist is right, I don't think making ' -> '' would do the job! << Then I wish you the best of luck.

Also, please maintain your open questions:
PHP + mcrypt w/ IIS Date: 05/27/2002 12:40PM PST
http://www.experts-exchange.com/webhosting/Q_20305118.html
(This last can be deleted as there are no contributions)
Stats + IIS Date: 05/27/2002 12:49PM PST  
http://www.experts-exchange.com/webhosting/Q_20305122.html
mcrypt Date: 05/22/2002 12:14PM PST
http://www.experts-exchange.com/php/Q_20303646.html
swf (flash) + php Date: 06/30/2002 11:20PM PST
http://www.experts-exchange.com/php/Q_20318115.html
HTTP Authentification Date: 07/02/2002 08:00PM PST  
http://www.experts-exchange.com/php/Q_20318931.html

Thanks,
Anthony

0
 
LVL 4

Expert Comment

by:Nazdor
ID: 7187907
Replace single quote with two single quotes

0
 
LVL 4

Expert Comment

by:Nazdor
ID: 7187920
Replace single quote with two single quotes

   '  ->  ''

Note that's not a double-quote (as in speech marks), it's an apostrophe, ascii characer 39.  This isn't overly clear in any of the posts above.

When SAVING data (as the original question asks), that is what you do (always replace all single-quotes with two-single-quotes).

This will be stored in the Database as a single quote.

When you next READ the data, it will have a single quote as expected.





0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7193550
Nazdor,

Thanks,
Anthony
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question