最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2006年11月17日 00:00:00   作者:  

復制代碼 代碼如下:
<%@ Language = VBSCRIPT %> 
<% Option Explicit %> 
<% 
rem 在asp中通過getrows實現(xiàn)數據庫記錄分頁的一段代碼 
  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 
%> 

相關文章

最新評論

本溪市| 大名县| 全椒县| 常宁市| 宁国市| 紫阳县| 麦盖提县| 眉山市| 大冶市| 高台县| 满洲里市| 尼木县| 宁夏| 当涂县| 岳西县| 抚远县| 诸暨市| 宜宾市| 金坛市| 沁阳市| 广东省| 长垣县| 大洼县| 万安县| 喜德县| 炉霍县| 桂东县| 肥西县| 武定县| 山东省| 凤城市| 司法| 沐川县| 资溪县| 迭部县| 无棣县| 保德县| 越西县| 湾仔区| 崇阳县| 河间市|