打开一个网页的时候,要求调用数据库,显示数据库里面的内容

来源:百度知道 编辑:UC知道 时间:2024/06/17 06:19:41
比如在网页上有一百个小格字,把access里数据库的内容按照号码顺序输出在网页上

用FOR循环可以实现,
按照号码是SQL里的排序功能。
如:
<%
page=clng(request.querystring("page"))
set rs=server.createobject("adodb.recordset")
if owen1<>"" and boardname <>"" then
sql="select id,title,oColor,oStyle,top,hits,infotime,firstimagename from news where bigclassname='"&owen1&"' and smallclassname='"&boardname&"' order by top desc,id desc"

elseif owen1<>"" then
sql="select id,title,oColor,oStyle,top,hits,infotime,firstimagename from news where bigclassname='"&owen1&"' order by top desc,id desc"
else
sql="select id,title,oColor,oStyle,top,hits,infotime,firstimagename from news order by top desc,id desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write("暂时没有记录")
else
%>
<tr>
<td wid