INSERT INTO (Unmatched Single Quotes) 
November 19th, 2008, 03:05 PM
| | | |
Does MS Access utilize something like a backlash (\) to make the
following SQL code work?
(SQL uses a backlash (\) to make the following SQL code work).
Here is my code:
INSERT INTO my_contacts
VALUES ('Funyon', 'Steve', 'steve@onionflavoredrings.com', 'M',
'1970-04-01', 'Punk', 'Grover's Mill, NJ', 'Single', 'smashing the
state', 'compatriots, guitar players');
I removed the unmatched single quote in the word ('Grover's -->
'Grovers) to make the code work in MS Access.
Thanks for your ideas!
John | 
November 19th, 2008, 03:15 PM
| | | | re: INSERT INTO (Unmatched Single Quotes)
On Nov 19, 8:56*am, zufie <john.marru...@illinois.govwrote: Quote:
Does MS Access utilize something like a backlash (\) to make the
following SQL code work?
>
(SQL uses a backlash (\) to make the following SQL code work).
>
Here is my code:
>
INSERT INTO my_contacts
VALUES ('Funyon', 'Steve', 'st...@onionflavoredrings.com', 'M',
'1970-04-01', 'Punk', 'Grover's Mill, NJ', 'Single', 'smashing the
state', 'compatriots, guitar players');
>
I removed the unmatched single quote in the word ('Grover's -->
'Grovers) to make the code work in MS Access.
>
Thanks for your ideas!
>
John
| Ok, found another solution...add a second single quote
(Grover''s)...This solution inputs the word Grover's with an
apostrophe as it should.
Here's my code:
INSERT INTO my_contacts
VALUES ('Funyon', 'Steve', 'steve@onionflavoredrings.com', 'M',
'1970-04-01', 'Punk', 'Grover''s Mill, NJ', 'Single', 'smashing the
state', 'compatriots, guitar players');
Thanks,
John | 
November 19th, 2008, 03:35 PM
| | | | re: INSERT INTO (Unmatched Single Quotes)
zufie wrote: Quote:
Does MS Access utilize something like a backlash (\) to make the
following SQL code work?
>
(SQL uses a backlash (\) to make the following SQL code work).
>
Here is my code:
>
INSERT INTO my_contacts
VALUES ('Funyon', 'Steve', 'steve@onionflavoredrings.com', 'M',
'1970-04-01', 'Punk', 'Grover's Mill, NJ', 'Single', 'smashing the
state', 'compatriots, guitar players');
>
I removed the unmatched single quote in the word ('Grover's -->
'Grovers) to make the code work in MS Access.
>
Thanks for your ideas!
>
John
| Don't know about the \. Not sure why the code above would work without
a field list.
You might be better off using a " instead of ' when surrounding the
values. IOW, "Grover's Mill, NJ" instead of 'Grover's Mill, NJ'
I created Table1 with fields F1 and F2. The following code worked IF a
record exists in Table1. If no records existed, nothing was inserted.
INSERT INTO Table1 ( F1, F2 )
SELECT Distinct "Test" , "Value" FROM Table1;
The above statement might be easier to write. |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|