C# ACCESS数据库出错原因小结

1. 最简单的原因是语法错误。

解决方法:在终端上试试,SQL命令串,是否可行。

2.比较隐秘的错误是insert报语法错误。

解决方法: 看看定义的字段是否与ACCESS关键字重复。

SQL和ACCESS保留字

SQL保留字
action add aggregate all
alter after and as
asc avg avg_row_length auto_increment
between bigint bit binary
blob bool both by
cascade case char character
change check checksum column
columns comment constraint create
cross current_date current_time current_timestamp
data database databases date
datetime day day_hour day_minute
day_second dayofmonth dayofweek dayofyear
dec decimal default delayed
delay_key_write delete desc describe
distinct distinctrow double drop
end else escape escaped
enclosed enum explain exists
fields file first float
float4 float8 flush foreign
from for full function
global grant grants group
having heap high_priority hour
hour_minute hour_second hosts identified
ignore in index infile
inner insert insert_id int
integer interval int1 int2
int3 int4 int8 into
if is isam join
key keys kill last_insert_id
leading left length like
lines limit load local
lock logs long longblob
longtext low_priority max max_rows
match mediumblob mediumtext mediumint
middleint min_rows minute minute_second
modify month monthname myisam
natural numeric no not
null on optimize option
optionally or order outer
outfile pack_keys partial password
precision primary procedure process
processlist privileges read real
references reload regexp rename
replace restrict returns revoke
rlike row rows second
select set show shutdown
smallint soname sql_big_tables sql_big_selects
sql_low_priority_updates sql_log_off sql_log_update sql_select_limit
sql_small_result sql_big_result sql_warnings straight_join
starting status string table
tables temporary terminated text
then time timestamp tinyblob
tinytext tinyint trailing to
type use using unique
unlock unsigned update usage
values varchar variables varying
varbinary with write when
where year year_month zerofill

ACCESS保留字
Microsoft Access 版本:1.0 , 1.1 , 2.0
Microsoft Access for Windows 95, version 7.0
Microsoft Access 97

 

3. 中文中的逗号混淆在正确的英文逗号分隔符号中。

会出现语法错或是字段数目不符等错误。

解决办法:仔细检查命令串

posted on 2017-09-14 23:15  不忘初心,知耻后勇  阅读(565)  评论(0编辑  收藏  举报

导航