<% sql="SELECT * FROM 聊天表 ORDER BY ID DESC" 降序输出查询结果 Set rootRs=conn.Execute(sql) set name=rootrs("姓名") 从数据库中获取姓名、说话、颜色、表情等 set Word=rootrs("说话") set colo=rootrs("颜色") set face=rootrs("表情") set who=rootrs("说话对象") %>
<%i=0%> 定义输出记录数 i
<%Do While Not rootRs.Eof and i<=50%> 显示50句话,包括姓名、话语、颜色、表情等 <%i=i+1%> <table border='0' cellpadding='0' cellspacing='0' width='85%'><tr> <td width='100%' bgcolor='#C0C0C0'></td></tr><tr><td width='100%'> <font color='#0000FF'><strong><%=name%></font></strong><font color='#008080'><%=face%></font><font color='#0000FF'><strong><%=who%>说: </font></strong><font color='<%=colo%>'><%=word%> </font></td></tr><tr> <td width='100%' bgcolor='#C0C0C0'></td></tr></table><br> <%rootRs.MoveNext Loop%>