日期:2014-05-18  浏览次数:20976 次

操作Access数据库时的怪事
往access表中插入数据:
insert   into   costrecord   values(120,#2007-09-05#, 'hh ',0, 'hh ', 'hh ')
这样是没有问题的

如果加上字段名:
insert   into   costrecord(index,cdate,item,cost,memo,name)   values(120,#2007-09-05#, 'hh ',0, 'hh ', 'hh ')
则会出现问题,   报这个错:
"Syntax   error   in   INSERT   INTO   statement. "
字段名都检查了,   没有错误.

是什么问题呢,   帮忙解答下

------解决方案--------------------
index,name是关键字,加方括号
insert into costrecord([index],[cdate],[item],[cost],[memo],[name]) values(120,#2007-09-05#, 'hh ',0, 'hh ', 'hh ')