
ASP 提示错误“标准表达式中数据类型不匹配”
我从一个页面表单传过来的值,<formname="form1"method="post"action="hit.asp"><inputtype="hidden"name=...
我从一个页面表单传过来的值,
<form name="form1" method="post" action="hit.asp">
<input type="hidden" name="hotid" value="<%=rs("id")%>"/>
<input class="button1" type="submit" name="submit" value=""/>
</form>
处理页面,
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data/guestbook.mdb")
hotid=request.form("hotid")
If hotid <> "" Then
Dim Arraya, i
Arraya = Split(hotid, ",")
For i = 0 to Ubound(Arraya)
Response.Write(hotid)
Next
End If
exec="update guest set hot=hot+1 where id='"&hotid&"'"
conn.execute exec
conn.close
set conn=nothing
是那hotid传过来的数据类型不对还是怎么的?在数据表的那个ID是自动编号 展开
<form name="form1" method="post" action="hit.asp">
<input type="hidden" name="hotid" value="<%=rs("id")%>"/>
<input class="button1" type="submit" name="submit" value=""/>
</form>
处理页面,
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data/guestbook.mdb")
hotid=request.form("hotid")
If hotid <> "" Then
Dim Arraya, i
Arraya = Split(hotid, ",")
For i = 0 to Ubound(Arraya)
Response.Write(hotid)
Next
End If
exec="update guest set hot=hot+1 where id='"&hotid&"'"
conn.execute exec
conn.close
set conn=nothing
是那hotid传过来的数据类型不对还是怎么的?在数据表的那个ID是自动编号 展开
1个回答
展开全部
exec="update guest set hot=hot+1 where id="&hotid
追问
我按你的这个写法写了,是没错误提示了,不过不能按ID=多少更新啊,一点每个都加1,相当于没有后面的条件 where id="&hotid ,
追答
那是因为你的SQL语句写错了。你可能执行的不是这里的这个SQL语句。这个写法不可能错的。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询