ASP记录

c48111926 2009-12-16 11:04:57

各位前辈帮看看哪里出错,我现在rs可以正常显示,rs1只显示一条记录并重复显示
<HTML>
<HEAD>
<title>七站</title>
<style type="text/css">
<!--
@import url("25175_1.css");
body {
margin-top: 0px;
background-image: url(../Imagess/1/vb1.gif);
}
.style18 {font-size: 12px}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>

<BODY>
<table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="1"><div align="center"></div></td>
</tr>
</table>
<table width="768" border="0" align=center cellpadding="0" cellspacing="0">
<tr> </tr>
<tr>
<td height="25" colspan=8 bgcolor="#A0A4AC"><a href="add.asp"> </a><a href="index.asp">首页</a> <a href="add.asp">添加</a> <a href="del.asp">删除</a> <a href="modify.asp">修改</a></td>
</tr>
<tr> </tr>
</table>
<table width="768" border="0" align="center" cellpadding="0" cellspacing="1">
<tr bgcolor="#A0A4AC">
<td width="50" height="25"> 姓名</td>

<td width="100">A类信息合计</td>
<td width="200">B类信息合计</td>
<td width="300">总信息合计</td>
</tr>
</table>
<div align="center">

<!--#include file="conn.asp" -->
<%

set rs=conn.execute("select mp_teemcode from jbb")
rs.open sql,conn,1,1
set rs1=conn.execute("select cj from jbb")
rs1.open sql,conn,1,1
if rs.EOF or rs.BOF then
Response.Write "数据库中暂无资料!"
else
do while not rs.EOF or rs.BOF
%>
</div>
<table width="407" border="1" align="center">
<tr>
<td><table width="139" border="0" align="center" cellpadding="0" cellspacing="1">
<tr bgcolor="#A0A4AC">
<td width="47" height="25"><span class="style18"><%=rs("mp_teemcode")%></span></td>
<td width="30"> </td>
<td width="25"> </td>
<td width="228"> </td>
</tr>
</table></td>
<td><table width="145" border="0" align="center" cellpadding="0" cellspacing="1">
<tr bgcolor="#A0A4AC">
<td width="50" height="25"><span class="style18"><%=rs1("cj")%></span></td>
<td width="100"> </td>
<td width="200"> </td>
<td width="300"> </td>
<!--备份 -->
</tr>
</table></td>
<td><table width="145" border="0" align="center" cellpadding="0" cellspacing="1">
<tr bgcolor="#A0A4AC">
<td width="50" height="25"> </td>
<td width="100"> </td>
<td width="200"> </td>
<td width="300"> </td>
</tr>
</table></td>
</tr>
</table>
<%
rs.movenext
loop
end if
set rs=nothing
set conn=nothing
%>
<table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="1"><div align="center"></div></td>
</tr>
</table>
</BODY>
</HTML>
...全文
73 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yan11cn 2009-12-17
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 c48111926 的回复:]
呵呵我太马虎了,1楼能帮我加个时间段查询么?比如输入2009-11-12到2009-11-15麻烦您了
[/Quote]

在form表单里添加两个input:
<input type="text" name="date1" />
<input type="text" name="date2" />
查询语句:sql="select * from table where date between "&request.form("date1")&" and " & request.form("date2")
这是一个简单处理
用于实际,最好完善用户输入错误的情况,还有非法字符过滤
Dogfish 2009-12-17
  • 打赏
  • 举报
回复
你使用rs循环,rs1在rs的循环里显示,当然rs1显示一个记录。

不知道楼主的本意。但是如果rs和rs1是同步的话,可以在rs.movenext之前写rs1.movenext
c48111926 2009-12-16
  • 打赏
  • 举报
回复
呵呵我太马虎了,1楼能帮我加个时间段查询么?比如输入2009-11-12到2009-11-15麻烦您了
c48111926 2009-12-16
  • 打赏
  • 举报
回复
应该填在哪里呀
yan11cn 2009-12-16
  • 打赏
  • 举报
回复
少了个rs1.movenext。。。

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧