 |
| SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 11th, 2003, 01:08 PM
|
|
Registered User
|
|
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ADODB.Recordset (0x800A0BCD)
Hi everybody,
Actually iam doing paging in asp and iam getting this error when iam trying to see the next page r any specified page.
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted.
The line that this error is poingting is
rs.AbsolutePage = PageIndex
iam getting the PageIndex value as 2 r 3 depends on number of pages according to the link i click.
can anyone help me out in this, like where and why this problem is happening.
thanx
williams
|
|

September 11th, 2003, 05:16 PM
|
|
Registered User
|
|
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
This is the coding that iam using ..
<%option explicit%>
<html><head><style type="text/css">
td{
font-family: verdana;
font-style: normal;
font-weight: bold;
font-size: .6em;
}
</style></head><body>
<%
dim conn, rs, str
dim ph,ai,dt,ph1,ai1
dim intI,intQ,intP
Dim rst
ph=request.form("ph")
ai=request.form("ai")
dt=request.form("dt")
set conn=Server.CreateObject("ADODB.Connection")
conn.open "dsn=test_db;uid=sa;pwd=test;"
str="select * from Manual_Call where tsragid='"&ai&"'"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open str,conn,3,3
Dim IntPageSize, PageIndex, TotalPages, TotalRecords
Dim RecordCount, RecordNumber
IntPageSize = 5
PageIndex = Request.QueryString("PageIndex")
'If pageIndex is empty, set it to one.
if PageIndex = "" then
PageIndex = 1
end if
RecordCount = rs.RecordCount
RecordNumber = (PageIndex * IntPageSize) - (IntPageSize)
' Set the number of records per page.
rs.PageSize = IntPageSize
'Define what page number on which the current record resides.
'rs.AbsolutePage = PageIndex
response.write(PageIndex)
TotalPages = rs.PageCount
dim intPrev, intNext
intPrev = PageIndex - 1
intNext = PageIndex + 1 'same as rs.AbsolutePage
'Build table header
With Response
.write "<table border=1 cellpadding=5 cellspacing=0>"
.write "<tr bgcolor=goldenrod>"
.write "<td>###</td>"
.write "<td>Name</td>"
.write "<td>Address</td>"
.write "<td>City</td>"
.write "<td>State</td>"
.write "<td>Phone</td>"
.write "<td>Agent Id</td>"
.write "<td>Date Of Call</td>"
.write "<td>Code</td>"
.write "</tr>"
end with
Dim Count 'We'll use this to limit the number of records displayed on a page
count=1
do while NOT rs.EOF AND Count <= IntPageSize
With Response
.Write"<tr>"
.Write "<td>" & RecordNumber + Count & "</td>"
.Write "<td>" & rs(0).value & "</td>"
.Write "<td>" & rs(1).value & "</td>"
.Write "<td>" & rs(2).value & "</td>"
.Write "<td>" & rs(3).value & "</td>"
.Write "<td>" & rs(5).value & "</td>"
.Write "<td>" & rs(22).value & "</td>"
.Write "<td>" & rs(21).value & "</td>"
.Write "<td>" & rs(17).value & "</td>"
.write "</tr>"
End with
count = count + 1
rs.MoveNext
loop
Response.Write "<tr><td align=center colspan=9 bgcolor=gainsboro>"
call BuildNav2 (intPrev,IntNext,TotalPages)
response.write "</td></tr></table>"
rs.close
%>
</body></html>
can anyone help me out.
thanx
williams
|
|

September 11th, 2003, 05:43 PM
|
|
Registered User
|
|
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The pages_support.asp contains the BuildNav2 function that contains the below coding.
----
<%
Sub BuildNav2 (intPrev,IntNext,TotalPages)
Dim counter
Response.Write "<b>"
' If the previous page id is not 0, then let's add the 'prev' link.
if intPrev <> 0 then
With Response
.Write "<a href=dpages.asp?PageIndex="
.Write intPrev & "><< previous</a>"
.Write NBSP(5)
End With
end if
'This section displays the list of page numbers as links, separated with the pipe ( | )
counter = 1
Response.Write "jump to page: "
do while counter <= TotalPages
' If the current page is the same as the counter, then write the page number with no hyperlink
if cint(counter) = cint(PageIndex) then
Response.Write counter
Else
' Else, let's write the page number as a hyperlink to that page
Response.Write "<a href=dpages.asp?PageIndex="
Response.Write counter & ">" & Counter & "</a>"
End if
' As long as we're not at the last page number in this loop, let's add a pipe to the string.
if cInt(counter) <> TotalPages then
Response.Write " | "
end if
counter = counter + 1
Loop
if (rs.AbsolutePage <> -3) then
With Response
.Write NBSP(5)
.Write "<a href=dpages.asp?PageIndex="
.Write intNext & ">next >></a>"
End With
end if
Response.Write "<br />" & rs.recordcount & " records found"
Response.Write "</b>"
end Sub
%>
'for making connection
<%
' set Connect=Server.CreateObject("ADODB.connection")
' strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\myweb\database\db1.mdb"
' Connect.ConnectionString = strCon
' Connect.open
' set conn=Server.CreateObject("ADODB.Connection")
' conn.open "dsn=test_db;uid=sa;pwd=test;"
%>
<%
function NBSP(count)
dim i
for i = 1 to count
NBSP = NBSP + " "
next
end function
%>
|
|

February 28th, 2005, 09:17 AM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Willis,
I have the same problem,i have tried so many things but it is showing the error.Plz someone give the answer ASAP.
|
|

March 1st, 2005, 03:34 AM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Willis,
Use this coding,it is working fine in my system.
<%
Dim currentPage,rowcount,i
currentpage=trim(request("currentpage"))
if currentpage="" then currentpage=1
set conn=server.CreateObject ("ADODB.connection")
conn.Open "DSN=pagedsn;UID=sa;PWD=sa;DATABASE=DAR"
set showdata=server.CreateObject ("ADODB.recordset")
showdata.CursorType = 3
showdata.PageSize = 2
showdata.Open sqlreport,conn
showdata.AbsolutePage = cint(currentpage)
rowcount=0
if showdata.EOF then Response.Write ("No Data in the Database")
while not showdata.EOF and rowcount < showdata.PageSize
Response.Write showdata(0)
Response.Write showdata(1)
Response.Write showdata(2)
Response.Write showdata(3)
Response.Write showdata(4)
Response.Write showdata(5)
Response.Write showdata(6)
Response.Write showdata(7)
Response.Write showdata(8)
Response.Write showdata(9)
Response.Write showdata(10) & "<br>"
rowcount=rowcount+1
showdata.MoveNext
Wend
Response.Write ""
for i=1 to showdata.PageCount
%>
<a href="pagefrmbook.asp?currentpage=<%=i%>"><%=i%></a>
<%
next
%>
<P> </P>
<%
showdata.Close
set showdata=nothing
conn.close
set conn=nothing
%>
|
|

March 1st, 2005, 04:24 AM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry,I forgot to include:
sqlreport="select * from db_users"
|
|
 |