日期:2014-05-20  浏览次数:20830 次

亲,sql修改语句,怎么就不对了呢
String sqlMod="Update wages set position="+Mposition+",base_pay="+Mbase_pay+", hour_pay="+
Mhour+",year_pay="+Myear_pay+",medical_pay="+Mmedi+
"traffic_pay="+Mtraffic+",travelling_pay=?"+Mtravlling+",other_pay="+Mother+",where num="+in;

报错3java.sql.SQLException: [Microsoft][ODBC Microsoft Access 驱动程序]COUNT 字段不正确


------解决方案--------------------
where前面的逗号是什么情况?

这种情形,System,out,println(sqlMode);马上就知道为什么了

------解决方案--------------------
亲,他说你有个COUNT 字段不正确呢,这在数据库是个关键字,Sqlserver里面要用[]括起来。
亲,你的where前的逗号是干啥的呢?
------解决方案--------------------
String sqlMod="Update wages set (position="+Mposition+",base_pay="+Mbase_pay+", hour_pay="+
Mhour+",year_pay="+Myear_pay+",medical_pay="+Mmedi+
"traffic_pay="+Mtraffic+",travelling_pay="+Mtravlling+",other_pay="+Mother+") where num="+in;

你这样试试,你sql语句有错误。
------解决方案--------------------
亲啊!你怎么不知道用Stringbuffer 来连接字符串呢啊?这样执行的效率高!还不易出错哦!