国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

asp中通過getrows實現(xiàn)數(shù)據(jù)庫記錄分頁的一段代碼

2019-11-18 20:16:22
字體:
供稿:網(wǎng)友
<%@ Language = VBSCRipT %>
<% Option Explicit %>
<%
rem 在asp中通過getrows實現(xiàn)數(shù)據(jù)庫記錄分頁的一段代碼
  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
%>

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 乐昌市| 卓资县| 苏尼特右旗| 广宗县| 东乡族自治县| 扶绥县| 岳西县| 绍兴市| 霞浦县| 嵩明县| 文山县| 商城县| 宁晋县| 浦江县| 哈巴河县| 遂溪县| 焉耆| 克东县| 崇明县| 漳州市| 甘孜县| 南部县| 玛沁县| 从江县| 个旧市| 呼和浩特市| 金堂县| 万载县| 西乌珠穆沁旗| 河池市| 宜阳县| 宁化县| 旅游| 万年县| 汝城县| 柞水县| 甘南县| 阜新| 渭源县| 丰都县| 登封市|