|
-
Dec 17th, 2002, 08:10 PM
#1
Thread Starter
Junior Member
INSERT INTO woes
Hello,
I needed another set of eyes to look at this statement since mine don't seem to do it.
I'm getting "Syntax error in INSERT INTO statement" when trying to add a row
to an Access 2000 table.
Happens on cmd.ExecuteNonQuery()
"INSERT INTO details
(County, City, Location, BegDate, EndDate, Group, Function, MeetingRoom)
VALUES ('PINELLAS', 'CLEARWATER', 'BELLEVIEW BILTMORE RESORT & SPA', #11/18/2002#, #12/1/2002#, 'Atofina Chemicals', 'Breakfast', 'Henry''s')"
Any ideas?
Thanks in advance!
-
Dec 17th, 2002, 09:30 PM
#2
Addicted Member
SQL statement
Change the names in your database for group and Function and try again . I had similar problems when I had field names of Name and Date- changed them to EMName and EMDate and the problems went away - really meningful error messages !!!.
hope this helps
regards
BH
-
Dec 17th, 2002, 09:40 PM
#3
Addicted Member
SQL statement
Also have you tried taking out the quotes from "Henrys" to see if thats the problem ??
BH
-
Dec 17th, 2002, 09:53 PM
#4
Thread Starter
Junior Member
I threw it into SQL Server and it gave me a better indication of what the error was. I changed Function and Group and now it goes right through.
Thanks.
As far as the double quotes, the entry is Henry's and you have to replace a single quote with two single quotes, otherwise your statement will end right there.
-
Dec 17th, 2002, 10:00 PM
#5
Thread Starter
Junior Member
You can also enclose a word like Group in [] in the statement to avoid errors just in case you don't want to change field names.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|