Print Page | Close Window

INSERT INTO syntax error

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=2234
Printed Date: 29 March 2026 at 8:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: INSERT INTO syntax error
Posted By: coolnlstuff
Subject: INSERT INTO syntax error
Date Posted: 28 April 2003 at 7:43am

I get the following error when i perform the insert into operation below:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

The code I use is as follows:

sql = "INSERT INTO Phrases_in_Dictations(Test_ID, Phrase_ID, Number) VALUES (8, 105, 1)"
SET rs = Conn.Execute(sql)
SET rs = Nothing

What's wrong with my sql-statement? I've been staring at it for about 45 minutes and don't see it.
   




Replies:
Posted By: michael
Date Posted: 28 April 2003 at 8:59am
Why oh why do people use reserved words as column names... just kidding. the word number is reserved in access so unless you cannot change the table anymore do the following:
INSERT INTO Phrases_in_Dictations(Test_ID, Phrase_ID, [Number]) VALUES (8, 105, 1)
As a tip, for database names, column names etc. try to never use dicitionary words. You never know what words might be reserved in an upcoming version. What I do a lot is have a datatype prefix or suffix e.g.   iID  and I would know it is an integer   cName  I know it is a char field....

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: coolnlstuff
Date Posted: 29 April 2003 at 2:43am

OK, sorry, didn't quite notice that....I'll change the names immediately.

Thanx again for finding the error!



Posted By: MorningZ
Date Posted: 30 April 2003 at 11:13am

For future reference, a list of ODBC Keywords:

http://www.flws.com.au/showusyourcode/codeLib/code/odbc_keywords.asp - http://www.flws.com.au/showusyourcode/codeLib/code/odbc_keywords.asp



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: coolnlstuff
Date Posted: 06 May 2003 at 3:08am
Tnx..i'll keep in in mind for the next time!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net