|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
<%@ Language = VBSCRIPT %> <% Option Explicit %> <% rem 在asp中通过getrows实现数据库记录分页的一段代码 Dim iStart, iOffset iStart = Request("Start") iOffset = Request("Offset") if Not IsNumeric(iStart) or Len(iStart) = 0 then iStart = 0 else iStart = CInt(iStart) end if if Not IsNumeric(iOffset) or Len(iOffset) = 0 then iOffset = 30 else iOffset = Cint(iOffset) end if Response.Write "Viewing " & iOffset & " records starting at record " & iStart & "<BR>" Dim objConn, objRS Set objConn = Server.CreateObject("ADODB.Connection") \\\'objConn.Open "DSN=MP3" dim connstr dim db db="csnjimageman.mdb" connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"") objconn.Open connstr Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "SELECT * FROM imageinfo", objConn Dim aResults aResults = objRS.GetRows objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing Dim iRows, iCols, iRowLoop, iColLoop, iStop iRows = UBound(aResults, 2) iCols = UBound(aResults, 1) If iRows > (iOffset + iStart) Then iStop = iOffset + iStart - 1 Else iStop = iRows End If For iRowLoop = iStart to iStop For iColLoop = 0 to iCols Response.Write aResults(iColLoop, iRowLoop) & " " Next Response.Write "<BR>" Next Response.Write "<P>" if iStart > 0 then \\\'Show Prev link Response.Write "<A HREF=""GetRows.asp?Start=" & iStart-iOffset & _ "&Offset=" & iOffset & """>Previous " & iOffset & "</A>" end if if iStop < iRows then \\\'Show Next link Response.Write " <A HREF=""GetRows.asp?Start=" & iStart+iOffset & _ "&Offset=" & iOffset & """>Next " & iOffset & "</A>" end if %> 返回类别: 教程 上一教程: 转变文本为超联和EMAIL格式的代码 下一教程: 如何在ASP中实现网络打印功能 您可以阅读与"ASP中通过GETROWS实现数据库记录分页的一段代码"相关的教程: · 在ASP中通过GETROWS实现数据库记录分页的一段代码 · ASP中利用数组实现数据库记录的批量录入方式 · ASP实现随机提取数据库记录例程 · ACCESS数据库表改名的一段代码 · 关于ACCESS数据库表改名的一段代码 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |