Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - INSERT INTO syntax error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

INSERT INTO syntax error

 Post Reply Post Reply
Author
coolnlstuff View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2003
Location: Netherlands
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote coolnlstuff Quote  Post ReplyReply Direct Link To This Post Topic: INSERT INTO syntax error
    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.
   

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
coolnlstuff View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2003
Location: Netherlands
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote coolnlstuff Quote  Post ReplyReply Direct Link To This Post 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!

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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

Contribute to the working anarchy we fondly call the Internet
Back to Top
coolnlstuff View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2003
Location: Netherlands
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote coolnlstuff Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2003 at 3:08am
Tnx..i'll keep in in mind for the next time!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.