asp读取access内容时怎样让重复的内容只显示一个!数据库表名为Info 15
读取的代码如下:<%'选项开始sql="select*fromInfoorderbyidasc"setrs=server.createobject("adodb.reco...
读取的代码如下:
<%
'选项开始
sql="select * from Info order by id asc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
k=rs.recordcount
if rs.bof and rs.eof then
response.write "<tr><td>抱歉,目前还没有评价信息</td></tr>"
end if
Do while not rs.eof
For m = 1 to k
%>
<tr onMouseOver="this.bgColor='#F0F7FF'" onMouseOut="this.bgColor='#FAFAFA'">
<td colspan="4">
<table width="98%" cellpadding="0" cellspacing="5" align="center">
<tr>
<td width="25%" align="center"><%=rs("xm")%></td>
</tr>
</table>
</td>
</tr>
<%
rs.movenext
Next
Loop
'选项结束
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<%
'选项开始
sql="select * from Info order by id asc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
k=rs.recordcount
if rs.bof and rs.eof then
response.write "<tr><td>抱歉,目前还没有评价信息</td></tr>"
end if
Do while not rs.eof
For m = 1 to k
%>
<tr onMouseOver="this.bgColor='#F0F7FF'" onMouseOut="this.bgColor='#FAFAFA'">
<td colspan="4">
<table width="98%" cellpadding="0" cellspacing="5" align="center">
<tr>
<td width="25%" align="center"><%=rs("xm")%></td>
<td width="55%"><%=m%>.<%=rs("Topic")%></td>
<td>
<%for n=1 to rs("TCount")%>
<input type="radio" name="Option<%=m%>" value="<%=rs("Option"&n)%>" title="请评价“第<%=m%>题”~!" /> <%=rs("Option"&n)%>
<%next%>
</td>
</tr>
</table>
</td>
</tr>
<%
rs.movenext
Next
Loop
'选项结束
rs.close
set rs=nothing
conn.close
set conn=nothing
%> 展开
<%
'选项开始
sql="select * from Info order by id asc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
k=rs.recordcount
if rs.bof and rs.eof then
response.write "<tr><td>抱歉,目前还没有评价信息</td></tr>"
end if
Do while not rs.eof
For m = 1 to k
%>
<tr onMouseOver="this.bgColor='#F0F7FF'" onMouseOut="this.bgColor='#FAFAFA'">
<td colspan="4">
<table width="98%" cellpadding="0" cellspacing="5" align="center">
<tr>
<td width="25%" align="center"><%=rs("xm")%></td>
</tr>
</table>
</td>
</tr>
<%
rs.movenext
Next
Loop
'选项结束
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<%
'选项开始
sql="select * from Info order by id asc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
k=rs.recordcount
if rs.bof and rs.eof then
response.write "<tr><td>抱歉,目前还没有评价信息</td></tr>"
end if
Do while not rs.eof
For m = 1 to k
%>
<tr onMouseOver="this.bgColor='#F0F7FF'" onMouseOut="this.bgColor='#FAFAFA'">
<td colspan="4">
<table width="98%" cellpadding="0" cellspacing="5" align="center">
<tr>
<td width="25%" align="center"><%=rs("xm")%></td>
<td width="55%"><%=m%>.<%=rs("Topic")%></td>
<td>
<%for n=1 to rs("TCount")%>
<input type="radio" name="Option<%=m%>" value="<%=rs("Option"&n)%>" title="请评价“第<%=m%>题”~!" /> <%=rs("Option"&n)%>
<%next%>
</td>
</tr>
</table>
</td>
</tr>
<%
rs.movenext
Next
Loop
'选项结束
rs.close
set rs=nothing
conn.close
set conn=nothing
%> 展开
3个回答
展开全部
sql="select distinct xm from Info order by id asc"
追问
不行啊!如果改成这样,下面的代码就运行不了!
追答
这个结构好象就有点问题
sql="select *,count(distinct xm) from Info ground by xm"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select xm from [table] group by xm
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
修改数据库吧,把“教学内容”“教学态度”“教学方法”放到一个表中用序号表示,其他表格牵扯到这些时,加入序号
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询