ASP+access查询语句,同时显示多条符合条件的记录,怎么写?

2025-02-27 15:53:59
推荐回答(1个)
回答1:

if request("type")="s" Then
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open "select * from 人员名单 where 姓名='张三'",conn,1,1
if rs.eof and rs.bof then
%>
       
        查无此人
       
 <%
 response.end
 end if
 
 do while not rs.eof
 %>
       
        <%=rs("姓名")%>
        <%=rs("性别")%>
       
<%
rs.movenext
loop
rs.close
end if
%>

你都没用循环当然只显示第一条啦。