none
Error in UPDATE statement Syntax with VB.NET and MS ACCESS

    Question

  • Friends,

    I am trying to update a record in an Access database, and when I send the following  statement:

    "UPDATE MESSAGES SET TEXT = 'xx' WHERE CODE = 3"

    ... while debugging I recieve an error, due to the UPDATE instruction syntax...

    What am i doing wrong?

    Wednesday, October 04, 2006 5:10 PM

Answers


  • The column name TEXT is a reserved word. You can either enclose it within brackets (e.g. [TEXT]) or rename the column.
    Wednesday, October 04, 2006 5:51 PM

All replies


  • The column name TEXT is a reserved word. You can either enclose it within brackets (e.g. [TEXT]) or rename the column.
    Wednesday, October 04, 2006 5:51 PM
  • I have changed the column name... and I get the exact same error, in the "sintax of the Update statement"...

    the sql string I am trying to execute now, is:

    UPDATE MESSAGES SET
      TEXTMSG = 'Bla, bla, bla',
      DATE = #12/12/2005#,
      VIA = 2, 
      DESCRIPTION = 'Bla2, bla2,...'
     WHERE CODE = 3

     

    Thanxs again.

     

    D.

    Thursday, October 05, 2006 2:02 PM

  • DATE is a reserved word. You may want to check the below lists before naming your columns:

    List of Microsoft Jet 4.0 reserved words
    List of reserved words in Access 2002 and Access 2003

    Thursday, October 05, 2006 2:35 PM
  • Excelente Paul. Thank you very much.
    Thursday, October 05, 2006 2:42 PM
  • This is what happens when you go from SQL to Access.  All heavens breaks loose!  I have been trying to solve this problem for 2 darn days!!

     

    ahh.... "Only Access"

    Friday, February 01, 2008 7:03 PM
  • Thanks so much for the link to the reserved words!

    I've had a few errors of this type, yet I have no idea usually which word is causing it.

    A bit of Cmd + F is all I need to find them now!

    - Formby.

    Wednesday, April 27, 2011 10:50 PM
  • Thanks Paul, your answer is very helpful for me. Hopefully you can help me to solve other problem if i've new one that i don't understand.
    Tuesday, November 27, 2012 5:05 PM