asp显示查询重复的记录

来源:百度知道 编辑:UC知道 时间:2024/05/11 18:49:51
数据库中有重复的姓名“uid_type”(例如:张三),怎样可以列出所有姓名是“张三”的数据。

下面的代码只能显示出第一个姓名是“张三”的数据:
<%
if request("action")="chk" then
id="<无匹配数据>"
uid="<无匹配数据>"
jd="<无匹配数据>"
sj="<无匹配数据>"
uid_type="<无匹配数据>"
uid_type=request("uid_type")
set rs=server.createobject("adodb.recordset")
if uid_type<>"" then
sql="select * from uid where uid_type='"&uid_type&"'"
rs.open sql,conn,1,1
on error resume next
id=rs("id")
uid=rs("uid")
jd=rs("jd")
sj=rs("sj")
uid_type=rs("uid_type")
rs.close
%>
<table width="100%" align="center" cellpadding="5" cellspacing="1">
<tr bgcolor="#F8F8F3">
<td width="

<%
if request("action")="chk" then
id="<无匹配数据>"
uid="<无匹配数据>"
jd="<无匹配数据>"
sj="<无匹配数据>"
uid_type="<无匹配数据>"
uid_type=request("uid_type")
set rs=server.createobject("adodb.recordset")
if uid_type<>"" then
sql="select * from uid where uid_type='"&uid_type&"'"
rs.open sql,conn,1,1
on error resume next
if rs.eof then
response.write("找不到数据")
else
do while not rs.eof
id=rs("id")
uid=rs("uid")
jd=rs("jd")
sj=rs("sj")
uid_type=rs("uid_type")
%>
<table width="100%" align="center" cellpadding="5" cellspacing="1">
<tr bgcolor="#F8F8F3&qu