学院首页>网络编程>ASP>asp 用存储过程实现数据分页

asp 用存储过程实现数据分页

作者: 来源: 添加时间:2006-5-21 18:42:04
四、search_koushi.asp


<!-- #include file="conn.asp" -->
<%
line=6
if request("page")="" then
page=1
else
page=request("page")
end if


if page<1 then
page=1
end if



title=trim(request("title"))
list2_id=trim(request("list2_id"))
set rs2=conn.execute("sp_c 'tiku_koushi','"&title&"','"&list2_id&"'")
pagecount=CInt(rs2(0)\line)
if(CInt(rs2(0)) mod line)=0 then
pagecount=pagecount
else
pagecount=pagecount+1
end if


if CInt(page)>=pagecount then
page=CInt(pagecount)
end if
str=""
str=str&"page="&page&"&title="&title&"&list2_id="&list2_id
set rs=conn.execute

("sp_search_tiku 'tiku_koushi','"&title&"','"&list2_id&"','"&line&"','"&CInt(page)&"'")
if rs.eof then
response.write "no record"

else
%>
<html>

<head>

<style type="text/css">

td{font-size:12px;}

a{text-decoration:none;}

</style>
<script language="javascript">
</script>
</head>

<body>
<table width="518" border="1" bordercolorlight="000000"
bordercolordark="#ffffff"
align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->

<tr bgcolor=#dfdfdf>

<td width="454" align="center" height=24 valign="middle">口试题的题目</td>

<td width="63" align="center" valign="middle">删除</td>

</tr>

<% do until rs.eof %>

<tr height=22>

<td valign="middle">·<a href=void(0)"

onclick="window.open('editkoushi.asp?id=<%=rs("id")%>&page=<%=page%>&title=<%=title%>&list2_id=<%=list2_id%>','','width=518
height=160 left=100')">

<%=rs("title")%></a></td>

<td align="center" valign="middle">删除</td>

</tr>

<%

第 2 页,共 3 页 [1] [2] [3]
站内搜索