We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Inserting ' into table from vb to access. (Urgent)

tomerps1 asked
Medium Priority
Last Modified: 2010-04-17
i am trying to insert a ' from a visual basci query into a table in access but getting systax error becase while building query v use ' as text container like in follwoing line.
plz help me out.

insert into tblStudent values( 1, 'Sachin's wife'); //error

insert into tblStudent values( 1, 'Sachin s wife'); //no error

is there any way to solve this problem easy & reliable.
plz help with some gud example of quotation
must be simple if u  have more than one solutions plz welcome
Watch Question

insert into tblStudent values( 1, 'Sachin''s wife');
Unlock this solution and get a sample of our free trial.
(No credit card required)
its doing same as venkateshwarr wrote, anyway ..
Unless I'm mistaken, that should be:

insert into tblStudent values( 1, 'Sachin\'s wife');
sorry ,
it should be
 insert into tblStudent values(1,'fixit(Sachin's wife)');
Mayank SPrincipal Technologist

>> insert into tblStudent values(1,'fixit(Sachin's wife)');

Guess it'll definitely not work. You're not calling the fixit () function. You're putting it as a constant 'fixit(...). Might give an error after Sachin'....

Perhaps what you can try is either what crazycomputers sugessted or if that doesn't work, use another dummy character instead of ' and while reading from the database, check if its that character and display ' in its place.
i meant

insert into tblStudent values(1,'" & fixit(Sachin's wife) & "');
The \ is standard for escaping special characters in SQL expressions, but we all know how M$ violates standards.  '' might work, but I'd put my money on \'


Thankx Nitesh Parmar
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.