ASP循环显示次数不正常

来源:百度知道 编辑:UC知道 时间:2024/05/17 02:33:29
<!--#include file="conn.asp"-->
<% set rs=server.createobject("adodb.recordset")
sql="select*from carinfromation,userlist"
rs.open sql,conn,1,1 %>
<%if rs.eof then
response.write"没有车辆信息。"
if session("userid")=admin then
response.write"<a href=carinformation.asp>添加车辆信息</A>"
end if
else %>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#bbffff" class="font2">
<th height="25" colspan="11">车辆基本信息</th>
<%if session("userid")=admin then %>
<td width="90"><a href="carinformation.asp">添加车辆信息</A></td>
<%end if%>

<tr>
<div align=left><TD height="25" ><font color="#8a00

rs.movefirst
do while not rs.eof

数据指针移到第一条记录,然后开始循环一直到最后一条记录,数据库有多少记录就循环多少次,你说循环显示次数多了8次,让人不解,你又没有指定循环次数

我的循环显示次数多了8次。。。。。

不太明白你的意思

将:rs.movefirst删去