% if request.querystring("postback")="1" then getkeyword=trim(request("keyword")) gettype=request("type") End if Set rsclass= Server.CreateObject ("ADODB.RecordSet") sqlclass = "select * from Class order by ClassID desc" rsclass.open sqlclass,conn,1,1 Set rs=Server.CreateObject("Adodb.Recordset") Set rs1=Server.CreateObject("Adodb.Recordset") Set rs2=Server.CreateObject("Adodb.Recordset") Set rs3=Server.CreateObject("Adodb.Recordset") 'Set rs4=Server.CreateObject("Adodb.Recordset") 'Set rs5=Server.CreateObject("Adodb.Recordset") Set rs6=Server.CreateObject("Adodb.Recordset") Set rs7=Server.CreateObject("Adodb.Recordset") SQL="Select top 6 * from news where type='59' " 'SQL1="Select top 6 * from news where type='44' " SQL2="Select top 6 * from news where type='45' " SQL3="Select top 6 * from news where type='46' " 'SQL4="Select top 6 * from news where type='41' " 'SQL5="Select top 6 * from news where type='42' " SQL6="Select top 6 * from news where type='67' " SQL7="Select top 6 * from news where type='68' " '-----------------------关键字查询 if getkeyword<>"" then sql=sql + " where title LIKE '%" & getkeyword & "%' " End if '-----------------------类别查询 if request.querystring("postback")="1" then if getkeyword<>"" and gettype<>"0" and gettype<>"" then sql=sql + " and type='" & gettype & "'" end if end if if request.querystring("postback")="1" then if getkeyword="" and gettype<>"0" and gettype<>"" then sql=sql + " where type='" & gettype & "'" end if end if SQL=SQL + " order by ID desc" 'SQL1=SQL1 + " order by ID desc" SQL2=SQL2 + " order by ID desc" SQL3=SQL3 + " order by ID desc" 'SQL4=SQL4 + " order by ID desc" 'SQL5=SQL5 + " order by ID desc" SQL6=SQL6 + " order by ID desc" SQL7=SQL7 + " order by ID desc" rs.open SQL,conn,1,1 'rs1.open SQL1,conn,1,1 rs2.open SQL2,conn,1,1 rs3.open SQL3,conn,1,1 'rs4.open SQL4,conn,1,1 'rs5.open SQL5,conn,1,1 rs6.open SQL6,conn,1,1 rs7.open SQL7,conn,1,1 dim gettype gettype=rs("type") 'dim gettype1 'gettype1=rs1("type") dim gettype3 gettype3=rs3("type") 'dim gettype4 'gettype4=rs4("type") dim gettype6 gettype6=rs6("type") dim gettype7 gettype7=rs7("type") dim gettype2 gettype2=rs2("type") 'dim gettype5 'gettype5=rs5("type") if rs.eof then errmeg1="没有任何新闻!" errmes1="1" else rs.MoveFirst '到第一条记录 rs.pagesize=MaxPerPage '定义每页记录数 'howmanyfields=rs.Fields.Count-1 CurrentPage= 1 If trim(Request("Page"))<>"" then CurrentPage= CLng(request("Page")) If CurrentPage> rs.PageCount then CurrentPage = rs.PageCount End If Else CurrentPage= 1 End If totalPut=rs.recordcount 'totalput=总记录数 if CurrentPage<>1 then if (currentPage-1)*MaxPerPage < totalPut then rs.move(currentPage-1)*MaxPerPage end if end if end if %>
| |
||
|
||
|
| 主办:厦门市文化局
承办:厦门图书馆 2003™ 版权所有© 保留所有权利 |