(一首先利用Access 2003建立一个名为list.mdb的数据库在里面建立一个名为list的表然后在list表里面输入一些你想要被查询的文件名字关键的搜索词还有相对应的链接下面建立了四个项目ID编号 title 主题word关键词 url 链接地址如下表所示ID title word url
1 cgi教程本地调试cgi cgi/testcgi.htm
2下载中心聊天室 留言本download/index.htm
二建立了数据库以后就可以建立你的asp搜索页面了下面是一个文件名
为search.htm的asp搜索页面的源程序这个搜索引擎可以同时搜索title和word里面的内容 当然如果你有需要的话可以建立更多的搜索
<!--i nclude file="ADOVBS.inc"-->
<%"建立数据库的连接con="DBQ="+server.mappath("list.mdb")+";DefaultDir=;DIRVER={microsoft AccessDriver(*.mdb)};"
"建立CONNECTION对象并打开数据库set mycon=server.createobj ect("ADODB.CONNECTION")mycon.open.con%>
"创建Recordset对象的例程打开Records et对象传递SQL串以及所有的
连接信息
<%set rs=server.createobj ect("ADODB.Recordset")rs.open"SELECT*FORM list where title and word like''%''
&request.form("word")&"%''",MyCon,adOp enStatie
%>
"建立查询后的显示信息和查询页面,你想取什么名字都可以
<html><head><title>查询结果</title></head>
<body bgcolor="#ffffff">
<p align="center"><br>
"统计查询共有<%Response.Write(RS.RecordCount)%>条纪录</p><br>
<div align="center"><center>
<table border="1"align="center"bordercolor="000000"berdorcoorlight="#000000"b ordercolordark="#ffffff">
<tr align="center">
<td width="20%"align="center"bgcolor="#ffffff">ID</td>
<td width="60%"align="center"bgcolor="#ffffff">主题</td>
<td width="20%"align="center"bgcolor="#ffffff">查看</td></table>
<table border="1"align="center"bordercolor="000000"berdorcoorlight="#000000"b ordercolordark="#ffffff">
<tr align="center">
<!--从数据库提取信息-->
<%while not rs.eof>
<tr align="center">
<td width="20%"align="center"bgcolor="#ffffff"><%=rs("id")%></td>
<td width="60%"align="center"bgcolor="#ffffff"><%=rs("title")%></td>
<td width="20%"align="center"bgcolor="#ffffff"><a href="<%=rs("url")%>">GO</a></td><%rs.movenext%></tr><%wend%></table></center></div><%rs.close%>
<%mycon.close%>
"关闭链接
</b ody></html>
下面我们来建立搜索页面
<html><head><title>搜索页面</title></head>
<!--创建搜索表格-->
<from method="POST"action="search.asp">
<div align="center"><center><p><input type="text"name="word" size="30">
<input type="submit"="提交"name="B 1"><input type="reset"="清除"name="B2"></p></c enter></di v></form>
<hr width="600"align="center">
<ht ml>
georgedatacenter怎么样?GeorgeDatacenter是一家2017年成立的美国商家,正规注册公司(REG: 10327625611),其实是oneman。现在有优惠,有几款特价VPS,基于Vmware。支持Paypal付款。GeorgeDatacenter目前推出的一款美国vps,2核/8GB内存/250GB NVMe空间/2TB流量/1Gbps端口/Vmware/洛杉矶/达拉...
BGP.TO目前针对日本和新加坡服务器进行促销,其中日本东京服务器6.5折,而新加坡服务器7.5折起。这是一家专门的独立服务器租售网站,提供包括中国香港、日本、新加坡和洛杉矶的服务器租用业务,基本上都是自有硬件、IP资源等,国内优化直连线路,机器自动化部署上架,并提供产品的基本管理功能(自助开关机重启重装等)。新加坡服务器 $93.75/月CPU:E3-1230v3内存:16GB硬盘:480GB ...
ZJI发布了9月份促销信息,针对香港华为云线路物理服务器华为一型提供立减300元优惠码,优惠后香港华为一型月付仅450元起。ZJI是原来Wordpress圈知名主机商家:维翔主机,成立于2011年,2018年9月更名为ZJI,提供中国香港、台湾、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册等业务,商家所选数据中心均为国内访问质量高的机房和线路,比如香港阿里云、华为...