zoukankan      html  css  js  c++  java
  • 操作ACCESS数据库,报INSERT INTO 语句的语法错误

    错误类型:
    Microsoft JET Database Engine (0x80040E14)
    INSERT INTO 语句的语法错误。

    有时候非常郁闷,明明看起来自己的语句没错,为什么还是报错呢?
    其实,常常因为自己不小心使用了系统的保留字,所以才造成了“没错报错”的局面。比如user,又比如password,两个保留字都曾被我误用,好在无意中看到了这篇文章,不然还真不知道自己要卡在这里多久……
    以下列出的是相关的ACCESS保留字,我下次一定要注意了。

     

    Access 2002/2003

    -A
          ADD
          ALL
          Alphanumeric
          ALTER
          AND
          ANY
          Application
          AS
          ASC
          Assistant
          AUTOINCREMENT
          Avg
    -B
          BETWEEN
          BINARY
          BIT
          BOOLEAN
          BY
          BYTE
    -C
          CHAR, CHARACTER
          COLUMN
          CompactDatabase
          CONSTRAINT
          Container
          Count
          COUNTER
          CREATE
          CreateDatabase
          CreateField
          CreateGroup
          CreateIndex
          CreateObject
          CreateProperty
          CreateRelation
          CreateTableDef
          CreateUser
          CreateWorkspace
          CURRENCY
          CurrentUser
    -D
          DATABASE
          DATE
          DATETIME
          DELETE
          DESC
          Description
          DISALLOW
          DISTINCT
          DISTINCTROW
          Document
          DOUBLE
          DROP
    -E
          Echo
          Else
          End
          Eqv
          Error
          EXISTS
          Exit
    -F
          FALSE
          Field, Fields
          FillCache
          FLOAT, FLOAT4, FLOAT8
          FOREIGN
          Form, Forms
          FROM
          Full
          FUNCTION
    -G
          GENERAL
          GetObject
          GetOption
          GotoPage
          GROUP
          GROUP BY
          GUID
    -H
          HAVING
    -I
          Idle
          IEEEDOUBLE, IEEESINGLE
          If
          IGNORE
          Imp
          IN
          INDEX
          Index, Indexes
          INNER
          INSERT
          InsertText
          INT, INTEGER, INTEGER1, INTEGER2, INTEGER4
          INTO
          IS
    -J
          JOIN
    -K
          KEY
    -L
          LastModified
          LEFT
          Level
          Like
          LOGICAL, LOGICAL1
          LONG, LONGBINARY, LONGTEXT
            
    -M
          Macro
          Match
          Max, Min, Mod
          MEMO
          Module
          MONEY
          Move
    -N
          NAME
          NewPassword
          NO
          Not
          Note
          NULL
          NUMBER, NUMERIC
    -O
          Object
          OLEOBJECT
          OFF
          ON
          OpenRecordset
          OPTION
          OR
          ORDER
          Orientation
          Outer
          OWNERACCESS
    -P
          Parameter
          PARAMETERS
          Partial
          PERCENT
          PIVOT
          PRIMARY
          PROCEDURE
          Property
    -Q
          Queries
          Query
          Quit
    -R
          REAL
          Recalc
          Recordset
          REFERENCES
          Refresh
          RefreshLink
          RegisterDatabase
          Relation
          Repaint
          RepairDatabase
          Report
          Reports
          Requery
          RIGHT
    -S
          SCREEN
          SECTION
          SELECT
          SET
          SetFocus
          SetOption
          SHORT
          SINGLE
          SMALLINT
          SOME
          SQL
          StDev, StDevP
          STRING
          Sum
    -T
          TABLE
          TableDef, TableDefs
          TableID
          TEXT
          TIME, TIMESTAMP
          TOP
          TRANSFORM
          TRUE
          Type
    -U
          UNION
          UNIQUE
          UPDATE
          USER
    -V
          VALUE
          VALUES
          Var, VarP
          VARBINARY, VARCHAR
    -W
          WHERE
          WITH
          Workspace
    -X
          Xor
    -Y
          Year
          YES
          YESNO
            
    以及以下标点符号
         .
         /
         *
         ;
         :
         !
         #
         &
         -
         ?
         "
         '
         $


    Access 2000

    -A
          ADD
          ALL
          Alphanumeric
          ALTER
          AND
          ANY
          Application
          AS
          ASC
          Assistant
          AUTOINCREMENT
          Avg
    -B
          BETWEEN
          BINARY
          BIT
          BOOLEAN
          BY
          BYTE
    -C
          CHAR, CHARACTER
          COLUMN
          CompactDatabase
          CONSTRAINT
          Container
          Count
          COUNTER
          CREATE
          CreateDatabase
          CreateField
          CreateGroup
          CreateIndex
          CreateObject
          CreateProperty
          CreateRelation
          CreateTableDef
          CreateUser
          CreateWorkspace
          CURRENCY
          CurrentUser
    -D
          DATABASE
          DATE
          DATETIME
          DELETE
          DESC
          Description
          DISALLOW
          DISTINCT
          DISTINCTROW
          Document
          DOUBLE
          DROP
    -E
          Echo
          Else
          End
          Eqv
          Error
          EXISTS
          Exit
    -F
          FALSE
          Field, Fields
          FillCache
          FLOAT, FLOAT4, FLOAT8
          FOREIGN
          Form, Forms
          FROM
          Full
          FUNCTION
    -G
          GENERAL
          GetObject
          GetOption
          GotoPage
          GROUP
          GROUP BY
          GUID
    -H
          HAVING
    -I
          Idle
          IEEEDOUBLE, IEEESINGLE
          If
          IGNORE
          Imp
          IN
          INDEX
          Index, Indexes
          INNER
          INSERT
          InsertText
          INT, INTEGER, INTEGER1, INTEGER2, INTEGER4
          INTO
          IS
    -J
          JOIN
    -K
          KEY
    -L
          LastModified
          LEFT
          Level
          Like
          LOGICAL, LOGICAL1
          LONG, LONGBINARY, LONGTEXT
            
    -M
          Macro
          Match
          Max, Min, Mod
          MEMO
          Module
          MONEY
          Move
    -N
          NAME
          NewPassword
          NO
          Not
          NULL
          NUMBER, NUMERIC
    -O
          Object
          OLEOBJECT
          OFF
          ON
          OpenRecordset
          OPTION
          OR
          ORDER
          Orientation
          Outer
          OWNERACCESS

    -P
          Parameter
          PARAMETERS
          Partial
          PERCENT
          PIVOT
          PRIMARY
          PROCEDURE
          Property
    -Q
          Queries
          Query
          Quit
    -R
          REAL
          Recalc
          Recordset
          REFERENCES
          Refresh
          RefreshLink
          RegisterDatabase
          Relation
          Repaint
          RepairDatabase
          Report
          Reports
          Requery
          RIGHT
    -S
          SCREEN
          SECTION
          SELECT)
          SET
          SetFocus
          SetOption
          SHORT
          SINGLE
          SMALLINT
          SOME
          SQL
          StDev, StDevP
          STRING
          Sum
    -T
          TABLE
          TableDef, TableDefs
          TableID
          TEXT
          TIME, TIMESTAMP
          TOP
          TRANSFORM
          TRUE
          Type
    -U
          UNION
          UNIQUE
          UPDATE
          User
    -V
          VALUE
          VALUES
          Var, VarP
          VARBINARY, VARCHAR
    -W
          WHERE
          WITH
          Workspace
    -X
          Xor
    -Y
          Year
          YES
          YESNO
            


    以及以下标点符号
         .
         /
         *
         :
         !
         #
         &
         -
         ?
         ;
         "
         '
         $

  • 相关阅读:
    StreamWrite写ASCII文本文件时,中文变成问号的处理
    asp.net错误处理封装
    C#减少图片文件大小和尺寸
    关于《代码大全2》
    关于重载
    Oracle移机
    用delphi模仿.net的string.split
    Oracle817搞怪
    oracle取得系统时钟
    15 个新鲜精彩的jQuery教程
  • 原文地址:https://www.cnblogs.com/xrtd/p/3678188.html
Copyright © 2011-2022 走看看