怎么把数据库中某个字段的值赋值给一个变量

来源:百度知道 编辑:UC知道 时间:2024/05/16 18:10:48
ASP中的VBSCRIP怎么把数据库中某个字段的值赋值给一个变量,请帮我改改这个代码,错在哪,很急用,初学者dim num,rnum,roomname1
num= Request.Form("num")
roomname1=Request.Form("roomname")
rnum="select rnum from dbo.room where roomname=roomname1"
If num>rnum Then
Response.Write("<script>alert('预定的房间数不够');location='javascript:history.go(-1)'</script>")
response.end
end if
帮帮忙吧,真的很急啊

rnum="select rnum from dbo.room where roomname=roomname1"
这一句只是一个查询语句,下面还得有类似:
rs.open rnum,conn,1,1
的数据,然后再改为上:
If num>rs.recordcount Then