This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
For some reason, I can connect to but can't do the "INSERT INTO" statement on my database. The simple mdb file is here .. anyone, if there's an obvious reason why I can't insert data, and you could explain it to me...it would greatly be appreciated. It actually only has 3 entries in it... Its really weird because every other database, I can connect to. But I'm new to Databases so I might be overlooking something simple. Its just a Microsoft access Database .. nothing too complicated
Below the main part of code I use to connect to the database.
Any insight my problem would be appreciated.
[ November 29, 2007: Message edited by: Eric Belec ] [ November 29, 2007: Message edited by: Eric Belec ]
Order is a reserved word in SQL, just like Select and From to name just a few.
You still can use these as names for tables and columns, if you surround them with the table/column name escape characters. In Access and SQL, that is [ and ], so it would be "INSERT INTO PizzaOrder ([Order]) VALUES('5')". For some other database types it might be ` and `.
Correct. The only reserved word I use as column name myself is "name", and that one is only a reserved word in MS SQL Server (well, Query Analyzer marks it in blue ;)).
Unfortunately, sometimes other manufacturers are not as wise. I once had problems installing a package on a MS SQL Server 2005 server. The problem was that one of the column names was a reserved word. We had to enable using reserved words as columns and turn the database compliancy to SQL Server 2000 for it to work. Bloody morons.