CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Microsoft JET Database Engine (0x80040E14) Syntax error in INSERT INTO statement (or) Syntax error in UPDATE INTO statement

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    69
  • Date Created
    Tuesday, December 14, 2010
  • Last Updated
    Tuesday, December 14, 2010
  • This Article Has been Viewed
    2343 times
  • Short Desc
    In Microsoft Access, if you name your Column a reserved word, you may get this error when running your ASP INSERT (or) UPDATE Statement
  • Details
    In Microsoft Access Database when you create your Table for Users and name the password column as: Password, you will get the error below.

     
    Microsoft JET Database Engine (0x80040E14)
    Syntax error in INSERT INTO statement.
    /Inserts.asp, line 36


    You are receiving this error because the word Password is a reserved word for Access.
    Now, if you are the own of the Database, I would suggest changing the word to something else (or) if you are planning on switching over to SQL Server in the near future, then you can leave the Password alone as it will not give you a problem in SQL Server.
  • Recreate Issue
    To recreate this issue.
    Have your Access Users Table column named: Password

    Your SQL INSERT (or) UPDATE statement will be like so:

    INSERT

    <%
    sql.commandtext="insert into mytable (username, password)values(?,?)"
    %>


    UPDATE

    <%
    sql.commandtext="update mytable set username=?, password=? where uid=?"
    %>
  • Resolve Issue
    To correct this error

    Scenario #1:
    Rename the Column in your Access Database from
    Password
    to
    myPassword

    Scenario #2:
    Wrap the password name in your Statement with brackets []

    INSERT

    <%
    sql.commandtext="insert into mytable (username, [password])values(?,?)"
    %>


    UPDATE

    <%
    sql.commandtext="update mytable set username=?, [password]=? where uid=?"
    %>