Solved

' and Access

Posted on 2002-07-17
8
154 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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 75

Accepted Solution

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

Anthony
0
 

Expert Comment

by:kuist
Comment Utility
'' 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
Comment Utility
hello?
0
 

Author Comment

by:nfuids
Comment Utility
yeah, kuist is right, I don't think making ' -> '' would do the job!
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
>>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
Comment Utility
Replace single quote with two single quotes

0
 
LVL 4

Expert Comment

by:Nazdor
Comment Utility
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
Comment Utility
Nazdor,

Thanks,
Anthony
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now