INSERT INTO 语句的语法错误
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
:[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。2010-05-19 8:27
最近在搞EJB开发,用的是ACCESS数据库。结果出现
15:06:07,031 INFO [STDOUT] 执行插入有错误:[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。
15:06:07,031 INFO [STDOUT] 执行插入有错误:[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。
看了半天我的SQL语句,没有问题啊。
String sql = "insert into
Sign(dateTime,IP,classDay,classOrder,studentID) values('" + signDefalutinfo.getDateTime()+
"','"+signDefalutinfo.getIP()+"','"+signDefalutinfo.getClassDay()+"', '"+signDefalutinfo.getClassOrder()+"','"+signDefalutinfo.getStudentID ()+"')";
查了半天才知道是因为使用了Access的关键字。为了避免大家犯同样的错误,现将Access的关键字列出来,如果以后在编程中你遇到了同样的错误,请看看是否使用了Access的关键字。
-A
ADD
ALL
Alphanumeric
ALTER
AND
ANY
Application
AS
ASC
Assistant
AT
AUTOINCREMENT
Avg
-B
BETWEEN
BINARY
BIT
BOOLEAN
BY
BYTE
-C
CHAR, CHARACTER
COLUMN
CompactDatabase
CONSTRAINT
Container
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
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
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
Password
PERCENT
PIVOT
PRIMARY
PROCEDURE
Property
-Q
Queries
Query
Quit
-R
REAL
Recalc
Recordset
REFERENCES
Refresh
RefreshLink