Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

SQL update

New Here ,
Jan 16, 2009 Jan 16, 2009
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
TOPICS
Database access
515
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 16, 2009 Jan 16, 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 16, 2009 Jan 16, 2009
LATEST
This article

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

contains links to the Reserved Words lists for every version of Access.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources