当前位置:编程学习 > asp >>

刚写的应用于某软件的全文检索程序

<p> <!--#include file=function/conn.asp-->
<br>
<%
keyWord=trim(request("oKey"))
sType=trim(request("oType"))
if keyWord="" or keyWord="关键字…" then
Response.Write "请输入关键字!"
Response.End()
end if
if sType="" then
Response.Write "请选择查询信息类别"
Response.End()
end if
dim ftsTable '要查询信息的储存表名
dim ftsFolder '要查询信息的储存文件夹 
if sType="1" then
ftsTable="tb_bzxx"
ftsFolder=fjroot
elseif sType="2" then
ftsTable="tb_other"
ftsFolder=fjroot_other
elseif sType="3" then
ftsTable="tb_info"
ftsFolder=fjroot_info
else
Response.Write "出错了!"
Response.End
end if
sql=""
if sType="1" then
sql="select bz_xuhao as xuhao,bz_name as bname,bz_code as bcode,bz_htm as htm from " & ftsTable
elseif sType="2" then
sql="select p_xuhao as xuhao,p_name as bname,p_code as bcode,p_htm as htm from " & ftsTable
elseif sType="3" then
sql="select info_id as xuhao,info_htm,info_type as htm from " & ftsTable
else
Response.Write "出错了!"
Response.End
end if
Call OPenConn() ' 打开数据库连接
set fso=server.CreateObject("scripting.filesystemobject")
set rs=server.createobject("adodb.recordset")
dim oPattern
oPattern="<p>|<p(.*)>|</p>"
'如果是查询第三种信息(其他信息),则先将所有的信息类别取出来,放到数组中。
dim infoType()
if sType="3" then
rs.Open "select type_id,type_name from tb_info_type order by type_id desc",adocon,3,1
if rs.RecordCount<=0 then
CloseRs rs
Call CloseConn
Response.Write "出错了!"
补充:asp教程,高级应用
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,