473,808 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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****@onionfla voredrings.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 4496
On Nov 19, 8:56*am, zufie <john.marru...@ illinois.govwro te:
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...@onionfla voredrings.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)...T his solution inputs the word Grover's with an
apostrophe as it should.

Here's my code:

INSERT INTO my_contacts
VALUES ('Funyon', 'Steve', 's****@onionfla voredrings.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****@onionfla voredrings.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
3105
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 character that may cause problems. My query is: "insert into questions(UserID,Question) values (".$HTTP_POST_VARS.",'".$HTTP_POST_VARS."')"
3
6792
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 or so. I have a HTML form that posts data to the following ASP file: <HTML> <HEAD> <TITLE>Sight Bites</TITLE> </HEAD>
26
13331
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
3105
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 ahead and added a replace to replace the ' with " but now other fields are having the same problem and there are multiple fields involved. This data gets into having a lot of symbols used, etc. So rather than go through and replace these quotes...
24
22667
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 quotes? Do I need to use code to scrub each string and remove or escape the double quotes before using it in a query? The error I get is this: Error Number 3075: Syntax error (missing operator) in query expression '"credit card billed by...
11
16240
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, Col3, Col4) Values(" & _ str1 & "," & dt1 & "," & str2 & "," & str3 & ")" where str1 = "col1"
15
5271
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 seconds exceeded in /web/myadmin/283/libraries/import.lib.php on line 19" appears but no indication as why the command fails. Any advice most welcome. INSERT INTO `countries` ( `id` , `country` ) VALUES ('1', 'Abkhazia'), ('2',...
2
2803
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 add comment data to a table. I calculate and/or determine all of the variables except for that comment.
4
3963
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 scalars dynamically by some other process. When i send these values to the subroutine containing an insert query, there for the columns containing varchar i need to have ' some value' for int no quotes are requried. For example if we take $name,...
0
9600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10113
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9195
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.