人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

分欄顯示記錄集的表格演示,并完成了分頁

分欄顯示記錄集的表格演示,并完成了分頁

更新時間:2022-08-14 文章作者:未知 信息來源:網絡 閱讀次數:

<!-- 本示例演示一個通用的記錄集分欄顯示,因為有的時候顯示產品等要每行顯示若干個,而不是每行顯示一個。如有有這種分欄顯示的表格,直接把下面的代碼套進去就行了,本示例是每行顯示2個記錄,再最下面還顯示了分頁欄。 -->
<%
'打開數據庫
Set conn = Server.CreateObject("ADODB.Connection")
strconn="Driver={sql server};server=localhost;database=northwind;uid=sa;pwd=sa;"
conn.Open strconn
'獲取本頁地址
Dim fileName,postion
fileName = Request.ServerVariables("script_name")
postion = InstrRev(fileName,"/")+1
fileName = Mid(fileName,postion)
'打開記錄集www.knowsky.com
set rs=server.CreateObject("adodb.recordset")
rs.open "select titleofcourtesy,firstname,photopath from Employees order by employeeid desc",conn,1,1 
%>
<!-- 產品展示表格 -->
       <table width="90%" height="300"  border="0" align="center">
<%
if not(rs.bof and rs.eof) then
pages=4
rs.pagesize=pages
if not isempty(Request.QueryString("page")) then
 thispage=clng(Request.QueryString("page"))
else
 thispage=1
end if
rscount=rs.recordcount
if thispage="" then thispage=1
if thispage<1 then thispage=1
if (thispage-1)*pages>rscount then
 if (rscount mod pages)=0 then
  thispage=rscount\pages
 else
  thispage=rscount\pages+1
 end if
end if
if(rscount mod pages)=0 then
 allpages=rscount\pages
else
 allpages=rscount\pages+1
end if
rs.absolutepage=thispage
i=1
%>
                        <tr>
<%do while not rs.eof and  pages>0 %>
                          <td valign="top"><a href="<%=rs("PhotoPath")%>" target="_blank"><img src="<%=rs("PhotoPath")%>" alt='分欄顯示記錄集的表格演示,并實現了分頁' width="100" height="100" border="0"></a><br>
                          <%=rs("titleofcourtesy")&rs("firstname")%> </td>
<%
'分欄主要由下面這個判斷來執行的,本例是每行顯示兩欄
if (i mod 2) =0 then
%>
      </tr><tr>
<%end if%>      
<%
pages = pages - 1
rs.movenext
i=i+1
loop
end if
%>
   
                      </table>
<!-- /產品展示表格 -->
<!-- 產品分頁表格 -->
                      <table width="90%"  border="0" align="center">
                        <tr>
                          <td> <center>
 共<%=allpages%>頁&nbsp;當前第<%= thispage %>頁&nbsp;
 <% if thispage<>1 then %>
 <a href="<%=filename&"?page=1"%>">首頁</a> <a href="<%=filename&"?page="&(thispage-1)%>">上頁</a>
 <% End If %>
 <% if thispage<>allpages then %>
  <a href="<%=filename&"?page="&(thispage+1)%>">下頁</a> <a href="<%=filename&"?page="&allpages&""%>">末頁</a>
  <% End If %>
  </center></td>
                        </tr>
                      </table>
<!-- /產品分頁表格 -->

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 嘉峪关市| 丽水市| 会泽县| 舞钢市| 大宁县| 旬邑县| 资阳市| 绿春县| 子洲县| 浠水县| 莎车县| 三门峡市| 晋中市| 衡南县| 安徽省| 宁乡县| 凤山市| 海盐县| 甘泉县| 马鞍山市| 陆良县| 营山县| 大荔县| 林周县| 罗定市| 罗甸县| 福贡县| 浦县| 大安市| 南阳市| 乐陵市| 晴隆县| 保德县| 柯坪县| 喀喇| 石屏县| 金华市| 柳州市| 嘉义县| 溆浦县| 镇雄县|