<%
Select case stype
case 1
if fs=1 then
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" &flzdmc &_
" like '%"&QueryWords(i)&"%')"
tempJoinWord = " and "
Next
else
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" &flzdmc &_
"='"&QueryWords(i)&"' )"
tempJoinWord = " and "
Next
end if
case 2
if fs=1 then
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & flzdmc & _
" like '%"&QueryWords(i)&"%')"
tempJoinWord = " and "
Next
else
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & flzdmc &_
"='"&QueryWords(i)&"')"
tempJoinWord = " and "
Next
end if
case 3
if fs=1 then
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & flzdmc&_
" like '%"&QueryWords(i)&"%')"
tempJoinWord = " and "
Next
else
For i = 0 To UBound( QueryWords )
sql = SQL & tempJoinWord & "(" & flzdmc &_
"='"&QueryWords(i)&"')"
tempJoinWord = " and "
Next
end if
End Select
if sql="" then
sql="id=99999999999 "
end if
sqlzs = "SELECT id FROM [kxzdk] WHERE " &sql
'response.write sqlzs
'response.end
%>
<%
set rs = server.CreateObject ("adodb.recordset")
rs.open sqlzs,conn,1,1
if rs.bof and rs.eof then
else
totalPut=rs.recordcount '计算出符合条件总数
totalnumber=rs.recordcount '计算出符合条件总数
end if
rs.close
if CurrentPage=1 then
sql="SELECT top "&MaxPerPage&" id,hanzi FROM [kxzdk] WHERE "&sql '总页码为1取当前页
else
sqlzs="(select top "&((CurrentPage-1)*MaxPerPage)&" id FROM [kxzdk] WHERE "&sql '使用组合查询方式
sql="SELECT top "&MaxPerPage&" id,hanzi FROM [kxzdk] WHERE id>(select max(id) from "&sqlzs&" order by id ) AS T ) and "&sql&" order by id "
end if
dim ares
rs.open sql ,conn,1,1
if rs.bof and rs.eof then
redim ares(-1,-1,-1)
else
ares = rs.GetRows
end if
rs.close
set rs=nothing
Conn.Close
Set Conn = Nothing
dim ls_jlzs
ls_jlzs=UBound(ares,2)
'response.write ls_jlzs
'response.end
if (ls_jlzs<0 or ls_jlzs="" ) then
if keyword="" then
response.write " 您没有输入关键字! |
"
else
response.write " 抱歉,没有找到与 "&keyword&" 相关的任何内容! |
"
end if
else
if ls_jlzs=0 then
Response.Redirect("kxzdshow.asp?id="&stoies(right("0000000"&ares(0,0),7)))
end if
if (totalPut mod MaxPerPage)=0 then
tempPcount= totalPut \ MaxPerPage
else
tempPcount= totalPut \ MaxPerPage + 1
end if
if (totalPut mod MaxPerPage)=0 then
Pcount= totalPut \ MaxPerPage
else
Pcount= totalPut \ MaxPerPage + 1
end if
if currentpage > Pcount then currentpage = Pcount
if currentpage<1 then currentpage=1
dim bookmark,iia
j=(currentpage-1)*MaxPerPage+1
ii=0
response.write ""
showpage()
response.write "
"
if keyword<>"" then
end if
response.write ""
For iia =1 To ls_jlzs+1
if keyword<>"" then
if iia mod 5=0 and iia<>ls_jlzs+1 then
response.write ""&ares(1, iia-1)&" |
"
else
response.write ""&ares(1, iia-1)&" | "
end if
else
response.write "
您没有输入关键字! |
"
end if
j=j+1
next
end if
erase ares
response.write "
"
showpage()
response.write "
"
else
response.write "
抱歉,您没有输入任何查询数据 ! |
"
end if
sub showpage()
dim filename,ii,n
filename="kxzdso.asp"
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "
"& vbCrLf
end sub
Function stoies(str)
dim mz,t, a,a1,a2,a3,b,x
mz="e,b,d,c,e,8,9,7,6,5,4,3,2,1,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
t=""
b=split(mz,",")
for x=0 to len(str)-1
a=AscW(mid(str,x+1,1))
a1=a Mod 41
a=(a-a1)/41
a2=a Mod 41
a=(a-a2)/41
a3=a mod 41
t=t&b(a3)&b(a2)&b(a1)
next
a="z"
for x=0 to len(t)-1 step 3
if AscW(x)<>"A" then
stoies=t
Exit Function
end if
a=a+mid(t,x+1,2)
next
stoies=a
end function
function ekstos(str)
dim b
b="ebdce897654321fghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ"
dim a1,a2,a3,d,a
dim t()
d=1
if Mid(str,1,1)="z" then
redim t(fix(len(str)-1)/2)
a= UBound(t)
dim x
for x=0 to a-1 step 1
d=d+1
a2=instr(b,mid(str,d,1))
d=d+1
a3=instr(b,mid(str,d,1))
t(x)=a2*41+a3
next
else
redim t(fix(len(str)/3))
a= UBound(t)
for x=0 to a-1 step 1
a1=instr(1,b,mid(str,d,1))
d=d+1
a2=instr(b,mid(str,d,1))
d=d+1
a3=instr(b,mid(str,d,1))
d=d+1
t(x)=(a1-1)*1681+(a2-1)*41+(a3-1)
next
end if
dim ra
ra=""
for x=0 to a-1 step 1
ra=ra&chrw(t(x))
next
ekstos=ra
end function
%>