473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

INSERT INTO (Unmatched Single Quotes)

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', 's****@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
Nov 19 '08 #1
2 4468
On Nov 19, 8:56*am, zufie <john.marru...@illinois.govwrote:
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', 's****@onionflavoredrings.com', 'M',
'1970-04-01', 'Punk', 'Grover''s Mill, NJ', 'Single', 'smashing the
state', 'compatriots, guitar players');

Thanks,

John
Nov 19 '08 #2
zufie wrote:
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', 's****@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.


Nov 19 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Bedford | last post by:
I've a textarea and would like to save the content in a mysql table each time a user click on a form. How can I do for avoiding error when the user put a " or a ' in the message, or any other...
3
by: Ian Griffiths | last post by:
I'm having issues witht the code I'm writing. I've dealt with SQL before, although only for extracting data, not adding it to the database. I've been intensively learning ASP/ADO over the past week...
26
by: rkleiner | last post by:
Is there a regular expression to find the first unmatched right bracket in a string, if there is one? For example, "(1*(2+3))))".search(/regexp/) == 9 Thanks in advance.
3
by: Jason | last post by:
I have several tables with quite a few fields and I'm getting errors when trying to insert records with single quotes in the data like: name = John O'Henry or a city name of O'Fallen So I went...
24
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double...
11
by: sm | last post by:
Hi All, Can anybody give me the syntax to insert a record into SQL server through VB code using variables? The following statement is failing! sInsertQuery = "INSERT INTO TestTab (Col1, Col2,...
15
by: abracad_1999 | last post by:
I am trying to populate a table with the following insert query run through phpmyadmin. When I attempt to run it phpmyadmin just freezes. After a while "Fatal error: Maximum execution time of 300...
2
by: jonceramic | last post by:
Hi, Question... Is there any way to put a wrapper on a raw string going through SQL, or should I bite the bullet and use a recordset method instead? Situation: I'm trying to have the user...
4
by: pavanponnapalli | last post by:
hi, I need to send some values to a subroutine where i use insert query. suppose say my scalar is as follows: my ($name,$number,$address) etc and i get the values into those...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.