asp数据库连接中的 rs 是什么意思

来源:百度知道 编辑:UC知道 时间:2024/06/22 19:48:12
set rs = server.createobject("adodb.recordset")
sql="select * from [host_ok] where id=" & Session("HostID")
rs.open sql,conn,1,1
if rs.bof and rs.eof then response.redirect("error.asp?id=001")
hostspace=rs("hostspace")
hostspacenow=rs("hostspacenow")
santilink=rs("antilink")&""
rs.close
set rs=nothing
if len(santilink)=0 then santilink=0
%>

比如上面的这断 谁能解释下rs 的意思 与其它代理的意思

set rs = server.createobject("adodb.recordset") 'rs是记录集对象
sql="select * from [host_ok] where id=" & Session("HostID")
rs.open sql,conn,1,1
if rs.bof and rs.eof then response.redirect("error.asp?id=001")
hostspace=rs("hostspace") ’将记录集中的hostspace字段内容读出,一下雷同
hostspacenow=rs("hostspacenow")
santilink=rs("antilink")&""
rs.close ‘关闭对象
set rs=nothing ’释放对象资源
if len(santilink)=0 then santilink=0 ‘如果santilink长度为0给它赋值0,好像这句话没意思,既然是0了还赋值吗,是不是写错了
%>

rs 是一个记录对象变量
recordset

其实rs就是你的sql查询出来的记录集合
简单说就是所有符合条件的数据库里的数据