Avatar of tomerps1
tomerps1

asked on 

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

Hi,
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
thankx
Programming

Avatar of undefined
Last Comment
tomerps1
Avatar of venkateshwarr
venkateshwarr

insert into tblStudent values( 1, 'Sachin''s wife');
ASKER CERTIFIED SOLUTION
Avatar of nilesh_parmar
nilesh_parmar

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of nilesh_parmar
nilesh_parmar

its doing same as venkateshwarr wrote, anyway ..
Unless I'm mistaken, that should be:

insert into tblStudent values( 1, 'Sachin\'s wife');
Avatar of nilesh_parmar
nilesh_parmar

sorry ,
it should be
 insert into tblStudent values(1,'fixit(Sachin's wife)');
Avatar of Mayank S
Mayank S
Flag of India image

>> 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.
Avatar of nilesh_parmar
nilesh_parmar

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 \'
Avatar of tomerps1
tomerps1

ASKER

Thankx Nitesh Parmar
Programming
Programming

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.

55K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo