ASP分段读取数据库代码
作者:gnbbs 来源:经典论坛 发布时间:2009-10-12 12:28:00
ASP如何分两段读取数据库?中间插入广告。代码如下:
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>aspxhome.com</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
#web {margin-left:auto; margin-right:auto; width:600px; height:auto; text-align:left; margin:0 auto}
.A {float:left; width:100%; height:auto; border:1px solid #CCC; background:#F8F8F8;}
.A ul {float:left; list-style-type:none;}
.A li {margin-top:8px; margin-bottom:8px;}
.B {float:left; width:100%; height:100px;}
-->
</style>
</head>
<body>
<div id="web">
<div class="A">
<ul>
<%
i=0
set rs=server.createobject("adodb.recordset")
sql ="select * from 表 order by 日期 Desc"
rs.open sql,conn,1,1
if rs.eof then
%>
没有文章
<%
else
do while not rs.eof
%>
<li><a href="<%=rs("路径")%>" target="_blank"><%=rs("标题")%></a></li>
<%
i=i+1
if i>=8 then exit do '显示条数
rs.movenext
loop
end if
rs.close
%>
</ul>
</div>
<!--广告-->
<div class="B"><br/>广告位置</div>
<div class="A">
<ul>
<%
i=0
set rs=server.createobject("adodb.recordset")
sql ="select * from 表 where 自动排列字段 not in (select top 10 自动排列字段 from 表 order by 日期 Desc) order by 日期 Desc"
rs.open sql,conn,1,1
if rs.eof then
%>
没有文章
<%
else
do while not rs.eof
%>
<li><a href="<%=rs("路径")%>" target="_blank"><%=rs("标题")%></a></li>
<%
i=i+1
if i>=8 then exit do '显示条数
rs.movenext
loop
end if
rs.close
%>
</ul>
</div>
</div>
</body>
</html>
猜你喜欢
- 这篇文章主要介绍了python批量启动多线程代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友
- 复数是由一个实数和一个虚数组合构成,表示为:x+yj一个复数时一对有序浮点数(x,y),其中x是实数部分,y是虚数部分。Python语言中有
- 鉴于最近一段时间一直在折腾的CNN网络效果不太理想,主要目标是为了检测出图像中的一些关键点,可以参考人脸的关键点检测算法。但是由于从数据集的
- 最近想做实时目标检测,需要用到python开启摄像头,我手上只有两个uvc免驱的摄像头,性能一般。利用python开启摄像头费了一番功夫,主
- 前言:c3p0 是一个开源的数据库连接池,实现了 JDBC 3 规范;本文主要介绍 c3p0 的基本使用,文中使用到的软件版本:Java 1
- 在将数据库从MSSQL迁移到MySQL的过程中,基于业务逻辑的要求,需要在MySQL的自增列插入0值。在MSSQL中是这样完成的: stri
- 1.变量的输入:input函数:input()input("请输入银行卡密码")password = input(&qu
- 问题描述python的pandas库中有一个十分便利的isnull()函数,它可以用来判断缺失值,我们通过几个例子学习它的使用方法。首先我们
- 1、Git版本库介绍每个Git版本控制系统的主机中,都可以包含若干个本地版本库,一般情况下一个本地版本库对应一个项目,用于对某个特定项目中的
- 前言说到面向对象,大家都不陌生。关系型数据库也是后端日常用来存储数据的,但数据库是关系型的,因此,ORM通过对象模型和数据库的关系模型之间建
- 本文转自微信公众号:"算法与编程之美",一、问题描述在collections模块中的defauldict使用时与dict
- 在良好的数据库设计基础上,能有效地使用索引是SQL Server取得高性能的基础,SQL Server采用基于代价的优化模型,它对每一个提交
- 这次主要记录python-Parser的用法,以及可能遇到的系列操作。1 前言if __name__ == "__main__&q
- import os,pandas as pd,re#1.获取文件夹下要合并的文件名dirpath = '文件夹地址'#工作表
- 摘要:本篇文章介绍了ORACLE数据库的新特性—分区管理,并用例子说明使用方法。 关键词:ORACLE,分区 一、 分区概述: 为了简化数据
- python中,A object = B object 是一种赋值操作,赋的值不是一个对象在内存中的空间,而只是这个
- 本文实例讲述了Python实现繁体中文与简体中文相互转换的方法。分享给大家供大家参考,具体如下:工作中需要将繁体中文转换成简体中文上网找了些
- 一、Visdom简介Visdom是由Facebook公司开发的一个进行数据可视化的Web应用程序,支持Torch、Numpy、Pytorch
- 基础这个模块是socket的异步实现,让我们先来熟悉一下模块中的一些类和方法:1.asyncore.loop输入一个轮询循环直到通过计数或打
- input高级限制级用法1.取消按钮按下时的虚线框 在input里添加属性值 hideFocus 或者 HideFocus=true2.只读