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

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

ASP應用范例-分頁_代碼局部

ASP應用范例-分頁_代碼局部

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


<%

dim Conn,RS,sqlStr,PageSize,RowCount,TotalPages,PageNo,Position,PageBegin,PageEnd

set Conn= Server.CreateObject("ADODB.Connection")

set RS = Server.CreateObject("ADODB.RecordSet")

Conn.open "provider=sqloledb;data source=127.0.0.1;user id=sa;password=;initial catalog=zjydata"

sqlStr="select * from Items order by iID"

RS.open sqlStr,Conn,1,1

PageSize=10

If RS.RecordCount=0 then

%>

<TABLE WIDTH=100% BORDER=0 CELLPADDING=1 CELLSPACING=1 style='font-size:9pt'>

<TR bgcolor=#003366 height=20px>

<TD align=center><font color=#FFFFFF>商品代碼</font></TD>

<TD align=center><font color=#FFFFFF>商品名稱</font></TD>

<TD align=center><font color=#FFFFFF>型號規格</font></TD>

<TD align=center><font color=#FFFFFF>計量單位</font></TD>

<TD align=center><font color=#FFFFFF>參考進價</font></TD>

<TD align=center><font color=#FFFFFF>參考售價</font></TD>

<TD align=center><font color=#FFFFFF>備注</font>

</TR>

<TR height=20px>

<TD align=center>沒有任何商品信息!</TD>

<TR>

</TABLE>

<%

else

RS.PageSize = Cint(PageSize)

TotalPages=RS.PageCount

PageNo=Request.QueryString("PageNo")

if PageNo="" or PageNo<1 Then

PageNo = 1

end if

RS.AbsolutePage = PageNo

Position=RS.PageSize*PageNo

PageBegin=Position-RS.PageSize+1

if Position <RS.RecordCount then

PageEnd=Position

else

PageEnd= RS.RecordCount

end if

%>

<TABLE WIDTH=100% BORDER=0 CELLPADDING=1 CELLSPACING=1 style='font-size:9pt'>

<TR>

<TD width=20%>

<%

Response.Write "頁:"& PageNo &" / "& TotalPages &" | 記錄:"& PageBegin & " - " & PageEnd & " / " &RS.RecordCount

%>

</TD>

<TD align=right>

<%

if PageNo > 1 Then

response.write "<a href=list.asp?PageNo=1>首頁</a>&nbsp;<a href=list.asp?PageNo=" & (PageNo-1) & ">上頁</a>&nbsp;"

end if

if TotalPages > 1 and cint(PageNo) <> cint(TotalPages) then

response.write "<a href=list.asp?PageNo=" & (PageNo+1) & ">下頁</a>&nbsp;<a href=list.asp?PageNo=" & TotalPages & ">末頁</a>&nbsp;"

end if

%>

</TD>

</TR>

<TR bgcolor=#003366 height=20px>

<TD align=center width=20%><font color=#FFFFFF>商品代碼</font></TD>

<TD align=center width=30%><font color=#FFFFFF>商品名稱</font></TD>

<TD align=center width=8%><font color=#FFFFFF>型號規格</font></TD>

<TD align=center width=8%><font color=#FFFFFF>計量單位</font></TD>

<TD align=center width=8%><font color=#FFFFFF>參考進價</font></TD>

<TD align=center width=8%><font color=#FFFFFF>參考售價</font></TD>

<TD align=center width=18%><font color=#FFFFFF>備注</font></TR>

<%

RowCount = RS.PageSize

dim color1,color2

color1="#dddddd"

color2="#eeeeee"

Do While Not RS.EOF and RowCount > 0

Response.Write "<TR height=20px bgcolor="

%>

<%

if RowCount mod 2=0 then:response.write color1 else:response.write color2

%>

<%

Response.Write ">"

%>

<TD><span><a href=manage.asp?id=<%=rs(0)%>><% =RS("vCode")%></a></span></td>

<TD><span><% =RS("vName")%></span></td>

<TD><span><% =RS("vSpec")%></span></TD>

<TD><span><% =RS("vUnit")%></span></td>

<TD><span><% =RS("fInPrice")%></span></td>

<TD><span><% =RS("fOutPrice")%></span></TD>

<TD><span><% =RS("vDescription")%></span></td>

</TR>

<%

RowCount = RowCount - 1

RS.MoveNext

Loop

Conn.Close

set RS = nothing

set Conn = nothing

%>

<TR bgcolor=#003366 height=20px>

<TD align=center width=20%><font color=#FFFFFF>商品代碼</font></TD>

<TD align=center width=30%><font color=#FFFFFF>商品名稱</font></TD>

<TD align=center width=8%><font color=#FFFFFF>型號規格</font></TD>

<TD align=center width=8%><font color=#FFFFFF>計量單位</font></TD>

<TD align=center width=8%><font color=#FFFFFF>參考進價</font></TD>

<TD align=center width=8%><font color=#FFFFFF>參考售價</font></TD>

<TD align=center width=18%><font color=#FFFFFF>備注</font>

</TR>

<TR>

<TD>

<%

For i=1 to TotalPages

if CInt(PageNo) = CInt(i) then

response.write "["&i&"]"

else

response.write "&nbsp<a href=list.asp?PageNo="&i&">"&i&"</a>&nbsp"

end if

Next

%>

</TD>

</TR>

</TABLE>

<%

End if

%>

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

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 田林县| 衢州市| 慈溪市| 长泰县| 普兰店市| 瑞昌市| 长宁县| 广西| 格尔木市| 富川| 岳阳县| 乌兰察布市| 肇庆市| 大余县| 贡山| 盐边县| 丰顺县| 舟曲县| 花垣县| 苍山县| 宜良县| 阳江市| 海淀区| 龙川县| 宜章县| 上饶市| 舒城县| 龙州县| 布拖县| 东辽县| 邵武市| 松阳县| 新蔡县| 大渡口区| 黄冈市| 新密市| 沽源县| 元谋县| 惠州市| 马边| 腾冲县|