|
你可以将这些写成1个函数如下: <%dim a1,b1,page,pagesize,pagecount a1=80
pagesize = 5 page = request("page") if page ="" or isnull(page) then page = 1 if not isnumeric(page) then page = 1 page = cint(page)
set rs=Server.CreateObject("ADODB.RecordSet") rs.open "SELECT * from ziliao1 where ziliao1_01 like ' "&a1&"' '",conn,3,3
rs.pagesize = pagesize pagecount = rs.pagecount if page < 1 then page = 1 elseif page > pagecount then page = pagecount end if%> <% if not rs.eof then ' 重复 rs.absolutepage = page end if %> <% dim i for i = 1 to pagesize if rs.eof then exit for %> <%=rs("zhiliao1_01")%> <%=rs("zhiliao1_02")%> <%=rs("zhiliao1_03")%> <%=rs("zhiliao2_01")%> <%=rs("zhiliao2_02")%> <%'这里调用要显示的信息,如会员照片 Call rs2loop(rs("zhiliao1_02"))%> <% rs.movenext() next %> <% '用来循环输出的函数... function rs2loop(rsid) set rs2=Server.CreateObject("ADODB.RecordSet") rs2.open "SELECT * from zhiliao2 where zhiliao2_01 like '"&rsid&"' ",conn,3,3 if not(rs2.eof and rs2.bof) then do while not rs2.eof .....'存在数据时循环 loop else '不存存数据时... end if rs2.close:set rs2=nothing end function%> |
|