参数不足,期待是 1 ??????

55555554646 2004-08-02 01:26:56
update news set news_title='sd',news_author='sdf',news_content='sdf',news_date='2004-8-2 1:25:17' where news_ID=21
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e10'

[Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1
...全文
144 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
海大富运动 2004-08-02
  • 打赏
  • 举报
回复
可能是类型不匹配!我刚回完贴,就碰见这个问题了,
if Request("type")="" then
Response.Write "<script>alert(""参数出错!!"")</script>"
Response.Write "<script>history.back()</script>"
Response.End
end if
Set rs=Server.CreateObject("adodb.recordset")
sql="select * from NewsSafe where type="&Request("type")//这个传递值不能这么写
rs.open sql,conn,1,3
if rs.eof or rs.bof then
%>


我改称这样就可以了
if Request("type")="" then
Response.Write "<script>alert(""参数出错!!"")</script>"
Response.Write "<script>history.back()</script>"
Response.End
end if
Set rs=Server.CreateObject("adodb.recordset")
sql="select * from NewsSafe where type='"&Request("type")&"'"
rs.open sql,conn,1,3
if rs.eof or rs.bof then
%>
楼主可以检查一下你的类型是否对应
ljjable 2004-08-02
  • 打赏
  • 举报
回复
sql="update news set news_title='sd',news_author='sdf',news_content='sdf',news_date='2004-8-2 1:25:17' where news_ID=21"
rs.open sql,conn,1,3
这样应该可以,应该是后面的参数1,3没有加~~
ycted 2004-08-02
  • 打赏
  • 举报
回复
这里是Microsoft的错误解释

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access 97 Driver]
Too few parameters.Expected 1.
原因
出现此错误是因为您在查询语法中使用了不存在的列名。通常,此错误只不过是一个拼写错误。将数据库中的列名与查询字符串进行对比检查。如果使用的是 Microsoft Access,请确保使用的是实际的列名,而不是列的“显示”名称。
ycted 2004-08-02
  • 打赏
  • 举报
回复
在就是一点原因是查询语法中所使用的列名不存在。 往往,这只是个打字错误。 请对照数据库中的列名,检查查询字符串中的列名。 如果使用的是 Microsoft Access,要确保使用的是实际列名,而不是列的“显示”名。
ycted 2004-08-02
  • 打赏
  • 举报
回复
还说两句.我记的我1年前也碰到过这样的情况.我前天才调试好的程序,第2天就出现和你一样的情况.我很是不解.搞的我最后没的办法重新建表,没想到的是,居然又好了.最后我也是搞不清楚而不了了之了.在这之后就在也没碰到过这样的情况.
最好的方法是楼主把sql语句write出来,一看就知道了.还有楼主的update是在循环里的吗?
wggipkhgef 2004-08-02
  • 打赏
  • 举报
回复
可能原因前面都说了,最主要可能有以下几点:
1.conn.execute(sql)
2.sql="update news set news_title='sd',news_author='sdf',news_content='sdf',news_date='#2004-8-2 1:25:17#' where news_ID=21"
3.conn.asp没include
ycted 2004-08-02
  • 打赏
  • 举报
回复
要不楼主试试
sql= "update news set "
sql= sql & "news_title='sd'"
sql= sql & ",news_author='sdf'"
sql= sql & ",news_content='sdf'"
sql= sql & ",news_date='2004-8-2 1:25:17'"
sql= sql & "where news_ID=21"
如过还不行就把sql语句打印出来看看.
kebeixueng 2004-08-02
  • 打赏
  • 举报
回复
rs.open sql,conn,1,3
海大富运动 2004-08-02
  • 打赏
  • 举报
回复
缺少包含conn.asp,不然就是字段缺少,我以前是这样的,呵呵~你有没有把adodb.recordset写错??news_date='#2004-8-2 01:25:17#'试试看
colinliu 2004-08-02
  • 打赏
  • 举报
回复
update news set news_title='sd',news_author='sdf',news_content='sdf',news_date='#2004-8-2 1:25:17#' where news_ID=21
ghy412 2004-08-02
  • 打赏
  • 举报
回复
估计是news_date='2004-8-2 1:25:17' 有问题
在查询分析器上能运行吗?
lamking 2004-08-02
  • 打赏
  • 举报
回复
这个错误提示好像是缺少字段吧?
55555554646 2004-08-02
  • 打赏
  • 举报
回复
你的意思是在 news_title 两边加上[]吗
还是不行呀
mjpclab 2004-08-02
  • 打赏
  • 举报
回复
应该是rs.open sql,conn
mjpclab 2004-08-02
  • 打赏
  • 举报
回复
sql="update news set [news_title]='sd',[news_author]='sdf',[news_content]='sdf',[news_date]='2004-8-2 1:25:17' where news_ID=21"

conn.excute(sql)
或rs.open sql
mjpclab 2004-08-02
  • 打赏
  • 举报
回复
update news set [news_title]='sd',[news_author]='sdf',[news_content]='sdf',[news_date]='2004-8-2 1:25:17' where news_ID=21

28,391

社区成员

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

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