我有一个ASP程序用了很久,但是查询功能一直修理不好.......
此查询,查找空字符,他回提示我,查询的是空字符,查没有的东西也可以查,但是查到已经有的名称,它就会提示.....
ADODB.Recordset 错误 '800a0cc1'
在对应所需名称或序数的集合中,未找到项目。
/ziyuan/flash2/search.asp,行158
我把这个SEARCH.ASP的代码提出来.是这样的....
<%
dim rstype
dim typesql
dim typeid,typename1
if not isEmpty(request("typeid")) then
typeid=request("typeid")
else
typeid=0
end if
set rstype=server.createobject("adodb.recordset")
typesql="select * from type where typeid="&typeid&""
rstype.open typesql,conn,1,1
if not rstype.eof then
typename1=rstype("type")
else typename1="全部FLASH"
end if
rstype.close
'---------------------------search----------------------
name=trim(request("keyword"))
name=replace(name,"'","''")
'Response.Write name
if typeid=0 then
sql="select * from learning where title Like '%"& name &"%' or title like title Like '%"& name &"%' or title Like '%"& name &"%'order by articleid desc"
else
sql="select * from learning where (typeid="&typeid&") and (title Like '%"& name &"%' or title like title Like '%"& name &"%' or title Like '%"& name &"%') order by articleid desc"
end if
set rs=conn.execute(sql)
'Rsponse.Write rs.RecordCount
if name="" then
'response.redirect"index.asp"
response.write"查找字符不能为空串,请重输入查找的信息
返回重查"
response.end
elseif rs.eof then
response.write"没有你要查找的信息
返回重查"
response.end
else
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
'set rs=server.createobject("ADODB.recordset")
'rs.open sql,conn
'searchsub rs
end if
%> <%
const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim typename
typename="软件搜索结果"
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
set rst=server.CreateObject("ADODB.RecordSet")
%>
查找结果
<% ' dim sql 'dim rs 'if request("hits")="1" then ' sql="select * from learning order by hits desc" 'else ' sql="select * from learning order by articleid desc" 'end if 'Set rs= Server.CreateObject("ADODB.Recordset") 'rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write " 还 没 有 任 何 软 件 " else 'totalPut=rs.recordcount totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if
end if if currentPage=1 then showpage totalput,MaxPerPage,"search.asp" showContent showpage1 totalput,MaxPerPage,"search.asp" else if (currentPage-1)*MaxPerPage rs.move (currentPage-1)*MaxPerPage dim bookmark bookmark=rs.bookmark showpage totalput,MaxPerPage,"search.asp" showContent showpage1 totalput,MaxPerPage,"search.asp" else currentPage=1 showpage totalput,MaxPerPage,"search.asp" showContent showpage1 totalput,MaxPerPage,"search.asp" end if end if rs.close end if set rs=nothing conn.close set conn=nothing
sub showContent dim i i=0 %> <% end sub function showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if Response.Write "" response.write "" Response.Write "共有软件:"&totalnumber&"个 "&CurrentPage&"/"&n&"页 | " response.write "" response.write "" if CurrentPage<2 then response.write " 首页 上一页 " else response.write " 首页 " response.write " 上一页 " end if if n-currentpage<1 then response.write " 下一页 尾页" else response.write " response.write ">下一页 尾页" end if Response.Write " | " 'response.write " 页次: " 'response.write " 共"&totalnumber&"个软件 "&maxperpage&"个软件/页 " 'response.write " 转到:" ' response.write "" end function function showpage1(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if Response.Write "" response.write " | " gotopage response.write " | " if CurrentPage<2 then response.write " 首页 上一页 " else response.write " 首页 " response.write " 上一页 " end if if n-currentpage<1 then response.write " 下一页 尾页" else response.write " response.write ">下一页 尾页" end if Response.Write " | " 'response.write " 页次: " 'response.write " 共"&totalnumber&"个软件 "&maxperpage&"个软件/页 " 'response.write " 转到:" ' response.write "" end function sub gotopage%> <%end sub function showpage1(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if Response.Write "" response.write " | " gotopage response.write " | " if CurrentPage<2 then response.write " 首页 上一页 " else response.write " 首页 " response.write " 上一页 " end if if n-currentpage<1 then response.write " 下一页 尾页" else response.write " response.write ">下一页 尾页" end if Response.Write " | " 'response.write " 页次: " 'response.write " 共"&totalnumber&"个软件 "&maxperpage&"个软件/页 " 'response.write " 转到:" ' response.write "" end function function showpage4(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if response.write "" end function %> |
|
|
在这里里面和整个程序我没有发现.home2.asp这个文件.........是缺少文件导致的吗?