请问,SQL查询结果,怎样超级链接查看另一页,急,先谢了!
<HTML>
<HEAD>
<TITLE>
ASP与SQL Server 2000数据库连接实例
</TITLE>
</HEAD>
<BODY background="bj10.gif">
<CENTER>
VB学习与讨论
<TABLE BORDER=1>
<TR>
<TD>文章题目</TD>
<TD>作者</TD>
<TD>发表之间</TD>
</TR>
<%
dim strsql
dim conn,studentRS
dim strconn
const pagesize=10
const first=1
const ostatic=3
const lopt=3
set conn=server.createobject("ADODB.Connection")
set studentrs=Server.CreateObject("ADODB.Recordset")
conn.open "DSN=student;UID=aspbook;PWD=asbook"
studentRS.open "select * from bbsarticle order by writedate desc",conn,3,3
studentRS.pagesize=pagesize
if studentRS.EOF then
response.write "!"
response.end
end if
currentpage=request.querystring("currentpage")
if currentpage="" then
currentpage=0
studentRS.movefirst
else
studentRS.move clng(currentpage)*pagesize
end if
%>共有<%=studentRS.recordcount%>条记录,现在显示的是第<%=currentpage+1%>页,第
<%=currentpage*pagesize+1%>条记录到<%
if (currentpage+1)*pagesize > studentRS.recordcount then
response.write studentRS.recordcount
else
response.write (currentpage+1)*pagesize
end if
%>条记录。<%if clng(currentpage)>0 then%>
<a href="showtitle1.asp?currentpage=<%=clng(currentpage)-1%>">上一页</a>/<%else%>
上一页/
<%end if%>
<%if clng(currentpage)<studentRS.pagecount-1 then%>
<a href="showtitle1.asp?currentpage=<%=clng(currentpage)+1%>">下一页</a>
<%else%>
下一页
<%end if%>
<%i=0%>
<%while i<pagesize and not studentRS.EOF
Response.Write "<TR>"
Response.Write "<TD>" & StudentRS.Fields("title") & "</TD>"想再次通过点击标题看内容但是不知道怎样加代码????????????????数据库子短:id ,title,author,context,writedate
Response.Write "<TD>" & StudentRS.Fields("author") & "</TD>"
Response.Write "<TD>" & StudentRS.Fields("writedate") & "</TD>"
response.Write "</TR>"
studentRS.MoveNext
i=i+1
wend
response.Write "</TABLE>"
studentRS.close
set studentRS=Nothing
conn.Close
set conn=Nothing
%>
<a href="writearticle2.asp">发表文章</a>
查找文章
</BODY>
</HTML>
相关推荐
sql 先精确查询后模糊查询方法
sql先精确查询后模糊查询的方法,百度了下网上没有找到合适的方法, 后来自己研究了CHARINDEX函数,发现可实行办法! 场景:公司部门提了个功能需求,要搜索商品表里的商品信息,先左匹配查询然后模糊查询 比如:要搜索衬衫,使用者需要先知道以衬衫%开头的,然后再去模糊查询xx衬衫xx, 一开始想到使用先精确查询,然后再模糊查询,再组合 select * from Produce where Name='\u886c\u886b' union select * from Produce where Name like '衬衫' 但是排序出来没办法实现 后来用CHARINDEX ,通过这种方式就可以实现 sel
SQL 列不同的表查询结果合并操作
两个不同的表进行查询,需要把结果合并, 比如table1的列为 id, user_id, type_id,pro_id; table2的列为 id,user_id,collect_id;分别如下图所示 table1: table2: 将两个表的查询结果合并到一起的查询语句为 select *, null as collect_id from table1 where user_id = 527 union select id,user_id,null as type_id,null as pro_id, collect_id from table2 where user_id = 527
将sql查询结果保存到数据表
sql查询,sql server,数据库导入导出,将查询结果插入表中
SQL查询日志 查看数据库历史查询记录的方法
好吧,到数据库日志中去找找,通过时间、关键字批配。。能想到的全用上吧。 首先假定你执行过它。没有?好吧,要么它太过简单,要么你太过不简单。。 代码如下: SELECT TOP 1000 –创建时间 QS.creation_time, –查询语句 SUBSTRING(ST.text,(QS.statement_start_offset/2)+1, ((CASE QS.statement_end_offset WHEN -1 THEN DATALENGTH(st.text) ELSE QS.statement_end_offset END – QS.statement_start_offset)
SQL高级查询技术.doc
SQL高级查询技术.doc


