参数不足,期待是 1 ??????
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
问题点数:0、回复次数:16Top
1 楼mjpclab(有只大猫猫 mjpclab.net)回复于 2004-08-02 01:32:26 得分 0
update news set [news_title]='sd',[news_author]='sdf',[news_content]='sdf',[news_date]='2004-8-2 1:25:17' where news_ID=21Top
2 楼mjpclab(有只大猫猫 mjpclab.net)回复于 2004-08-02 01:33:23 得分 0
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 sqlTop
3 楼mjpclab(有只大猫猫 mjpclab.net)回复于 2004-08-02 01:33:56 得分 0
应该是rs.open sql,connTop
4 楼55555554646(大工业)回复于 2004-08-02 01:36:58 得分 0
你的意思是在 news_title 两边加上[]吗
还是不行呀Top
5 楼lamking(卖空间,做网页 QQ:628557)回复于 2004-08-02 06:28:55 得分 0
这个错误提示好像是缺少字段吧?Top
6 楼ghy412(用心良苦)回复于 2004-08-02 07:27:04 得分 0
估计是news_date='2004-8-2 1:25:17' 有问题
在查询分析器上能运行吗?Top
7 楼colinliu(流浪人)回复于 2004-08-02 07:56:16 得分 0
update news set news_title='sd',news_author='sdf',news_content='sdf',news_date='#2004-8-2 1:25:17#' where news_ID=21Top
8 楼nighting1029(一个人的日子)回复于 2004-08-02 08:34:16 得分 0
缺少包含conn.asp,不然就是字段缺少,我以前是这样的,呵呵~你有没有把adodb.recordset写错??news_date='#2004-8-2 01:25:17#'试试看Top
9 楼kebeixueng(脱变的蚕)回复于 2004-08-02 08:45:39 得分 0
rs.open sql,conn,1,3Top
10 楼ycted(长城万里今犹在,不见当年秦始皇!)回复于 2004-08-02 08:49:55 得分 0
要不楼主试试
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语句打印出来看看.Top
11 楼wggipkhgef(不想说乔丹)回复于 2004-08-02 08:56:21 得分 0
可能原因前面都说了,最主要可能有以下几点:
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没includeTop
12 楼ycted(长城万里今犹在,不见当年秦始皇!)回复于 2004-08-02 09:02:14 得分 0
还说两句.我记的我1年前也碰到过这样的情况.我前天才调试好的程序,第2天就出现和你一样的情况.我很是不解.搞的我最后没的办法重新建表,没想到的是,居然又好了.最后我也是搞不清楚而不了了之了.在这之后就在也没碰到过这样的情况.
最好的方法是楼主把sql语句write出来,一看就知道了.还有楼主的update是在循环里的吗?Top
13 楼ycted(长城万里今犹在,不见当年秦始皇!)回复于 2004-08-02 09:06:20 得分 0
在就是一点原因是查询语法中所使用的列名不存在。 往往,这只是个打字错误。 请对照数据库中的列名,检查查询字符串中的列名。 如果使用的是 Microsoft Access,要确保使用的是实际列名,而不是列的“显示”名。Top
14 楼ycted(长城万里今犹在,不见当年秦始皇!)回复于 2004-08-02 09:07:53 得分 0
这里是Microsoft的错误解释
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access 97 Driver]
Too few parameters.Expected 1.
原因
出现此错误是因为您在查询语法中使用了不存在的列名。通常,此错误只不过是一个拼写错误。将数据库中的列名与查询字符串进行对比检查。如果使用的是 Microsoft Access,请确保使用的是实际的列名,而不是列的“显示”名称。Top
15 楼ljjable(吉)回复于 2004-08-02 09:10:38 得分 0
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没有加~~Top
16 楼nighting1029(一个人的日子)回复于 2004-08-02 09:53:34 得分 0
可能是类型不匹配!我刚回完贴,就碰见这个问题了,
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
%>
楼主可以检查一下你的类型是否对应
Top




