Skip to main content
Participant
January 17, 2009
Question

SQL update

  • January 17, 2009
  • 2 replies
  • 539 views
Here's my code:

<cfquery name="setNote"
datasource="#DS#" dbtype="ODBC"
username="#DSUsername#" password="#DSPassword#"
>
update Notes set note = 'test' where noteid = 1
</cfquery>

Seems simple enough, but I get this:

[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

Yeah, I know "Access Sucks.", but this still seems like it should work, no?

If I do a "select * from notes" and cfdump the results, I see the data that is there, I just can't update it.

What am I missing here?

Larry
This topic has been closed for replies.

2 replies

Participating Frequently
January 17, 2009
This article

http://www.databasedev.co.uk/ms-access-reserved-words.html

contains links to the Reserved Words lists for every version of Access.
Inspiring
January 17, 2009
NOTE is a reserved word in MS Access. either change the name of your
field to something else, or enclose it in [] (square brackets) in your
query:

UPDATE Notes SET [note]='test' WHERE noteid=1

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/