地下停车场效果图:asp参数不足这个问题还没解决呢

来源:百度文库 编辑:中科新闻网 时间:2024/04/30 03:13:25
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data/guestbook.mdb")
id="2"
tel="81677987"
sql="update book set tel='"&tel&"' where [id]="&id
conn.execute(sql)
conn.close
set conn=nothing
%>
book表
id为主键
tel数字型
上面这些答案都不行啊

<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data/guestbook.mdb")
id=2 '注意这里!!!
tel="81677987"
sql="update book set tel='"&tel&"' where [id]="&id
conn.execute(sql)
conn.close
set conn=nothing
%>

如果楼主的id为“自动编号”且数据库id 2中的tel项要有数据,也就是初始值(因为update是更新记录,不是添加),那么这个程序根本没有问题,我已经试过了,完全可以更新记录。

应该不会出错!
tel="&tel&"

请问你的表是什么样的?
id是主键吗?
以上的代码在我的机器上可以运行
id设置为数字类型
tel为文本类型

请确认:
1. 存在 book 这张表
2. 如果存在,存在 tel 和 id 这两个字段

你应该是写错了名字