S
s_m_b
I have two similar pages that pull the same data from a table and display
a range of it, based on 'number per page', so that users can quickly scan
and find a record.
On the original page, the code works fine:
''''''''''''''
NoUsersFlag = false
set rs = Server.CreateObject ("ADODB.Recordset")
rs.pagesize = perpage
rs.cachesize = perpage
Rs.CursorType = 3
Rs.LockType = 1
rs.open sql , conn, 3, 1 ,&H0001
if not rs.eof then
rs.movelast
rowcnt = rs.absoluteposition
rs.movefirst
end if
If PerPage = "" or (len(PerPage)>0 and not isnumeric(PerPage)) Then
PerPage = 10
If PageNum = "" or (len(PageNum)>0 and not isnumeric(PageNum)) Then
PageNum = 1
PerPage = clng(PerPage)
PageNum = clng(PageNum)
PageCnt = RowCnt \ PerPage
if RowCnt mod PerPage <> 0 then PageCnt = PageCnt + 1
if PageNum < 1 Then PageNum = 1
if PageNum > PageCnt Then PageNum = PageCnt
if not rs.eof then
rs.absolutepage = pagenum
rstart = rs.absoluteposition
rstop = rstart + (perpage-1)
'set rs = conn.execute(sql)
i=0
do while i < perpage and not rs.eof
'do while not rs.eof
strusername = replace(rs(2),"'","%27")
struserfname= replace(rs(1),"'","%27")
'userid,view,groupid,sfocus, mode
Response.Write ("<a href=""#"" onClick=""view('" &
rs(1) & "','" & view & "','" & groupid & "','" & focus & "','" & mode &
"');return false;"" >"&rs(0)&"</a><br/>" & vbLf)
rs.movenext
i = i+1
loop
else
Response.Write ("<p>No users in the group selected</p>" &
vblf)
NoUsersFlag = true
end if
''''''''''
on the second page, which displays the same stuff, just stripped down a
lot, the only response I get from the recordset is -1 for the
absoluteposition, which points to the wrong cursor/lock type.
how can this be, since the same core code is used ?
I did try experimenting with the
'''''
rs.open sql , conn, 3, 1 ,&H0001
'''
line (in the working page) but switching to '3, 3' caused the same -1
absoluteposition value.
I'm baffled by this behaviour.
a range of it, based on 'number per page', so that users can quickly scan
and find a record.
On the original page, the code works fine:
''''''''''''''
NoUsersFlag = false
set rs = Server.CreateObject ("ADODB.Recordset")
rs.pagesize = perpage
rs.cachesize = perpage
Rs.CursorType = 3
Rs.LockType = 1
rs.open sql , conn, 3, 1 ,&H0001
if not rs.eof then
rs.movelast
rowcnt = rs.absoluteposition
rs.movefirst
end if
If PerPage = "" or (len(PerPage)>0 and not isnumeric(PerPage)) Then
PerPage = 10
If PageNum = "" or (len(PageNum)>0 and not isnumeric(PageNum)) Then
PageNum = 1
PerPage = clng(PerPage)
PageNum = clng(PageNum)
PageCnt = RowCnt \ PerPage
if RowCnt mod PerPage <> 0 then PageCnt = PageCnt + 1
if PageNum < 1 Then PageNum = 1
if PageNum > PageCnt Then PageNum = PageCnt
if not rs.eof then
rs.absolutepage = pagenum
rstart = rs.absoluteposition
rstop = rstart + (perpage-1)
'set rs = conn.execute(sql)
i=0
do while i < perpage and not rs.eof
'do while not rs.eof
strusername = replace(rs(2),"'","%27")
struserfname= replace(rs(1),"'","%27")
'userid,view,groupid,sfocus, mode
Response.Write ("<a href=""#"" onClick=""view('" &
rs(1) & "','" & view & "','" & groupid & "','" & focus & "','" & mode &
"');return false;"" >"&rs(0)&"</a><br/>" & vbLf)
rs.movenext
i = i+1
loop
else
Response.Write ("<p>No users in the group selected</p>" &
vblf)
NoUsersFlag = true
end if
''''''''''
on the second page, which displays the same stuff, just stripped down a
lot, the only response I get from the recordset is -1 for the
absoluteposition, which points to the wrong cursor/lock type.
how can this be, since the same core code is used ?
I did try experimenting with the
'''''
rs.open sql , conn, 3, 1 ,&H0001
'''
line (in the working page) but switching to '3, 3' caused the same -1
absoluteposition value.
I'm baffled by this behaviour.