在同一页面中如何实现查询并分页显示结果

来源:百度知道 编辑:UC知道 时间:2024/06/10 15:08:17
<p> <!--#include file="..\conn.asp"-->
<%
key=request("key")
type1=request("type")
if key="" then
'response.write "<script>alert('查找字符串不能为空!');history.back();</'script>"
response.Write "<script>alert('查找字符不能为空,请重输入查找的信息')<a href=""javascript:history.go(-1)"">返回重查 </script></a>"
'call error()
response.end
end if
%>
</p>
<table width="700" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="#EEEEEE" style="border-collapse: collapse; border-style: dotted; border-width: 0px">

<%
page=clng(request("page"))

if type1="name" then
sql="select * from travelspot where

建立access的数据库news,还有表news,表的字段(id,title),id唯一,输入数据保存,用下面代码可查询,可分页
-----------------------下面保存为search.asp--------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>文件</title>
</head>
<body bgcolor="#ffffff">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script>
function btn_ck_bh_Click()
{
var cx = document.form1.cxsj.value;
form1.action ="search.asp?cx="+cx;
}
</script>
<table border="1" cellspacing="0" bgcolor="#F0F8FF" bordercolorlight="#4DA6FF" bordercolordark="#ECF5FF" width="88%" style="word-break:break-all">
<tr>
<td width="778" align="center" colspan="7">
<form me