悬赏1000分求access数据库查询代码

来源:百度知道 编辑:UC知道 时间:2024/06/17 16:56:27
数据库类型access 数据库名

:webdata316 数据库所放文件夹data ,要求查询的 表名为 News 字段为

Title 和 Content ,要求为在一个表格里输入要查询的内容,然后分页显示出关

键字所有的文章 ,并有超链接链到原文页面,只要合适立刻给分
能不能详细点啊,我刚学网站不久啊,不懂这么多啊,怎么改啊一楼的?? webdata316 数据库所放文件夹data ,要求查询的 表名为 News 字段为 ID , Title 和 Content 大小写区分啊 。怎么没人要分么????

这个你只要改下就可以了!

<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->

<%

dim key
dim sql
dim rs
dim rscount
dim page_count
dim page_size
dim currentpage
dim str_search
page_size=10

key=request("key")
if key<>"" then
str_search="key="& key
end if
sql="select * from tab where topic like '%"& key &"%' or content like '%"& key &"%' order by hot desc"

set rs = CreateObject("adodb.recordset")
rs.open sql,conn,1,1
rs.movelast
rscount=rs.recordcount
rs.pagesize=page_size
page_count=rs.pagecount
if request("currentpage")<>"" then
currentpage=request("currentpage")
if currentpage<=1 then currentpage=1
'if currentpage>=page_c