深圳lcd液晶显示器招聘:asp编程里,怎么在一个页里,同时打开两个记录集.

来源:百度文库 编辑:神马品牌网 时间:2024/05/14 07:05:19
程序是在不关闭一个记录集的情况一,打开同一个数据库里的另一个表.就是再打开别一个记录集,我的程序老是了错,那位大哥帮我一下.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="connections/conn.asp"-->

<%
dim rs,rs_r,nowpage
set rs=server.createobject("adodb.recordset")' 这里打开第一个记录集

sql="select * from book order by id desc"
rs.open sql,conn,1,1

%>

<%
if rs.pagecount<1 then
response.write("现在还没有人留言")
response.end()
end if
nowpage=request.querystring("nowpage")
if isempty(nowpage) then
nowpage=1
else
nowpage=nowpage
end if
rs.pagesize=4
rs.absolutepage=nowpage

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="style/css.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">

</script>
</head>

<body>

<%do while not rs.eof%>
<%=rs("id")%>
<table width="70%" align="center" cellpadding="0" cellspacing="0" class="table-book">

<%
set rs_r=server.createobject("adodb.recordset")'这里打开另一个记录集

rs_r.open select * from revert,conn,1,1
%>

<%'加入转换函数
str=rs_r("revert")
if isnull(str) then
str=""
else

str=Replace(str,chr(34),"")
str=Replace(str,chr(13)+chr(10),"<br>")
str=Replace(str,chr(9)," ")
str=Replace(str,"<","《")
str=Replace(str,">","》")
str=Replace(str,"《br》","<br>")
str=Replace(str,chr(32)," ")

end if

response.write(str)%></td>

简单 两种方式 一个是 双层使用 另一个是 先用 参数 来代替您要的值 还有 先关闭 rs 重新开一个!!!
不懂 25234805 是我的 qq 加我吧!!!