注册 登录
编程论坛 ASP技术论坛

看看这样对吗

lili0610931 发布于 2008-04-30 11:52, 407 次点击
<!--#include file="../inc/conn.asp"-->
<%
sql="select * from ad_music_class"
Set rs= Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
%>
<table width="200" border="1">
  <tr>
    <td>11</td>
    <td>11</td>
  </tr>
    <%
  do while(rs.next()) not
  %>
  <tr>
    <td><%=rs(name)%></td>
    <td><%=rs(pwd)%></td>
  </tr>
  <%loop%>
</table>


好像有点不对,帮我看看应该改哪里

[[it] 本帖最后由 lili0610931 于 2008-4-30 12:03 编辑 [/it]]
4 回复
#2
hxfly2008-04-30 12:43
<tr>
    <td><%=rs("name")%></td>
    <td><%=rs("pwd")%></td>
  </tr>
#3
lili06109312008-04-30 13:04
这里没有错,只不过是得到数据库里字段
这里只是显示出表里字段
是没有错的
#4
bjbaima2008-04-30 14:43
<!--#include file="../inc/conn.asp"-->
<%
sql="select * from ad_music_class"
Set rs= Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
%>
<table width="200" border="1">
  <tr>
    <td>11</td>
    <td>11</td>
  </tr>
  <%
  if not rs.eof and not rs.bof then
  do while not rs.eof%>
  <tr>
    <td><%=rs("name")%></td>
    <td><%=rs("pwd")%></td>
  </tr>
  <%
  rs.movenext
  loop
  else
  %>
  <tr><td colspan="2">暂无记录</td></tr>
  <%
  end if
  rs.close()
  set rs=nothing
  %>
</table>
#5
lili06109312008-04-30 14:53
谢谢了,知道哪里错了.谢谢你啊
1