求助!急??????????????

njtvwoshiisp 2004-04-13 12:51:53
str_addcm="insert into ywb_cablemodem (coustomserial,coustomname,coustomaddress,station,coustomopnode,coustomupkou,coutomphone,coustomdate1,cmmac,coustommoney,coustomdian,cmanzhuangdate,cmanzhuangren) values ('"&coustomserial&"','"&coustomname&"','"&coustomaddress&"','"&station&"','"&coustomopnode&"','"&coustomupkou&"','"&coustomphone&"','"&coustomdate1&"','"&cmmac&"','"&coustommoney&"''"&coustomdian&"','"&cmanzhuangdate&"','"&cmanzhuangren&"')"

请问大家我的语句错在哪儿啊?
出错信息为:
Microsoft][ODBC SQL Server Driver][SQL Server]There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
...全文
48 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
FlashK 2004-04-13
  • 打赏
  • 举报
回复
Response.Write str_addcm
然后在查询分析器中执行。
787912 2004-04-13
  • 打赏
  • 举报
回复
"&coustommoney&"''"&coustomdian
少逗号。
"&coustommoney&"','"&coustomdian

把你的SQL 语句显示出来
response.write str_addcm
response.end
FlashK 2004-04-13
  • 打赏
  • 举报
回复
"&coustommoney&"''"&coustomdian
少逗号。
"&coustommoney&"','"&coustomdian
njtvwoshiisp 2004-04-13
  • 打赏
  • 举报
回复
怎么打印啊?
FlashK 2004-04-13
  • 打赏
  • 举报
回复
建议你把SQL语句打印出来看。看是不是字段对应有问题。
说好不能打脸 2004-04-13
  • 打赏
  • 举报
回复
'"&coustommoney&"''"&coustomdian&"'我想不只这个问题,楼主最好打印:


response.write "str_addcm = " & str_addcm
response.end


eyun 2004-04-13
  • 打赏
  • 举报
回复
'"&coustommoney&"''"&coustomdian&"'
zhengxianping 2004-04-13
  • 打赏
  • 举报
回复
cmmac&"','"&coustommoney&"''"&coustomdian&"','"&cmanzhuangdate&"','"&cmanzhuangre
少逗号
coustommoney&"','"&coustomdian&"
lovewangshu 2004-04-13
  • 打赏
  • 举报
回复
在执行SQL前先用response.write str_addcm来看看你的SQL语句是否有问题
错误的提示信息是说你的值的个数小于你的字段个数了(more columns in the INSERT statement than values)
但是我看了是一样多的.是你的那些&和"出错了.

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧