• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 在asp中通過getrows實現數據庫記錄分頁的一段代碼

    發表于:2007-07-14來源:作者:點擊數: 標簽:
    %@ Language = VB SCRIPT % % 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
    <%@ 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
    %>


    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>