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

首頁 > 編程 > ASP > 正文

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

2024-05-04 10:58:47
字體:
供稿:網(wǎng)友

復(fù)制代碼 代碼如下:
<%@ 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   
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 德阳市| 罗源县| 呼伦贝尔市| 滁州市| 洛南县| 芷江| 涞源县| 龙口市| 保定市| 旌德县| 阿鲁科尔沁旗| 建昌县| 栾城县| 冀州市| 中西区| 新绛县| 长武县| 丹巴县| 洛阳市| 清徐县| 慈溪市| 嵩明县| 松滋市| 隆化县| 马鞍山市| 玛曲县| 苏州市| 大英县| 琼海市| 甘泉县| 湖州市| 黄梅县| 菏泽市| 老河口市| 饶河县| 肥乡县| 卓资县| 东源县| 和静县| 双鸭山市| 莱西市|