最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
在asp中通过getrows实现数据库记录分页的一段代码,希望对大家有用
时间:2022-07-02 23:46:46 编辑:袖梨 来源:一聚教程网
<%@ 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 & "
"
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)
<% 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 & "
"
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)
相关文章
- 2024金摇杆奖年度游戏名单 11-22
- 用针在纸上绣画是哪种非遗技艺 蚂蚁新村11月21日答案最新 11-22
- 重返未来1999纸信圈儿什么时候up 为什么故事集卡池活动介绍 11-22
- 重返未来1999雾中盛会怎么玩 UTTU聚光专栏雾中盛会活动介绍 11-22
- 光遇姆明季后续版本怎么玩 光遇音乐节宴会节活动介绍 11-22
- 无期迷途四星装束是谁 无期迷途首个四星装束剪影介绍 11-22