?
Solved

' and Access

Posted on 2002-07-17
8
Medium Priority
?
161 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 100 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

777 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