Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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
 
Old March 9th, 2005, 06:53 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default Either BOF or EOF is True, or the current record h

Howcome it doesn't work?

Quote:
quote:

ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/gemetria/kjvresp3.asp, line 0
It was working before!!!

Code:
<%Option Explicit
'this is an attempt to put kjvresp.asp into pageing.asp march 9 2005

' ADO constants used in this page
Const DB_NAME = "hebrewbible.mdb" ' Name of our database file
Const RECORDS_PER_PAGE  = 10            ' Number of records per page

Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adCmdTableDirect = &H0200
Const adUseClient = 3
%>

<html>
<head>
  <style>
  body { font-family : Verdana; font-size : 8pt; }
  a { font-family : Verdana; font-size : 8pt; text-decoration : none; }
  </style>
<script src="javascripts/calculator.js" type="text/javascript"></script>
<script src="javascripts/letters.js" type="text/javascript"></script>
</head>
<body>

<%
  Dim connStr
Private Function GetConnectionString()
    GetConnectionString =   "Driver={Microsoft Access Driver (*.mdb)};" & _
                "DBQ=" & Server.MapPath(DB_NAME) & ";" & _
                "UID=;PWD=;"
End Function

  Dim rs
    Set rs = Server.CreateObject("ADODB.Recordset")

    rs.PageSize = 10
    rs.CacheSize = 5
    rs.CursorLocation = adUseClient
    Set connStr = server.createobject("ADODB.Connection")
connStr.open GetConnectionString


    rs.PageSize = RECORDS_PER_PAGE
    rs.CacheSize = 5
    rs.CursorLocation = adUseClient
    Dim SQL
    SQL = "SELECT * FROM hebrewbibletable "


'    rs.Open, connStr, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
    RS.Open SQL, connStr, adOpenForwardOnly, adLockReadOnly
    Response.Write SQL

    If Len(Request("pagenum")) = 0  Then
        rs.AbsolutePage = 1
      Else
        If CInt(Request("pagenum")) <= rs.PageCount Then
            rs.AbsolutePage = Request("pagenum")
          Else
            rs.AbsolutePage = 1
        End If
    End If

    Dim abspage, pagecnt
      abspage = rs.AbsolutePage
      pagecnt = rs.PageCount

    If Not rs.EOF Then
      Response.Write "PageCount : " & rs.PageCount & "<br>" & vbcrlf
      Response.Write "Absolute Page : " & rs.AbsolutePage & "<br>" & vbcrlf
      Response.Write "Total number of records : " & rs.RecordCount & "<br><br>" & vbcrlf%>

        <%Dim fldF, intRec%>


<form name="conv_form">
<table border="1" cellspacing="1" bgcolor="#0066CC">
<tr style="height:12.75pt">

 <th bgcolor="#800000">Book<br></th>
 <th bgcolor="#800000">Chapter<br></th>
 <th bgcolor="#800000">Verse<br></th>
 <th bgcolor="#800000">Text</th>
 <th bgcolor="#800000">Text in Hebrew</th>
  </tr>

   <%  dim page
       dim i
' skip the dummy records
if not rs.eof then
rs.Move (page-1)*rs.pagesize
     ' Display the records
for i=1 to rs.pagesize
%>
<tr>
<td align=center BGCOLOR="#FFFFFF">
<%=rs("book")%>
</td>

<td nowrap align=center BGCOLOR="#FFFFFF">
<%=rs("chapter")%>
</td>

<td nowrap align=center BGCOLOR="#FFFFFF">
<%=rs("verse")%>
</td>
<td align=right BGCOLOR="#FFFFFF">
<%=rs("text_data")%>
<br>
</span>
</td>

 <td nowrap align=right BGCOLOR="#FFFFFF">

  <h4>Unicode</h4>
<textarea name="unic_area" rows="3" cols="16"
 class="onLoad" onmouseover="this.className='onMouseOver'"
 onmouseout="this.className='onMouseOut'">
 </textarea>

 </td>
</tr>
   <%rs.movenext
      ' Exit the loop when reaching the end of the recordset
If rs.EOF Then Exit For 'end if
next
end if%> 
 </table>
 <br>

<center> <input name="convert" type="button" value="Convert" onclick="mc2unic()"></center>
<br>
<br>
</center>
</form>        
<%        ' Now showing first, next, back, last buttons.
        Response.Write "<div align=""center"">" & vbcrlf
        Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=1"">First Page</a>"
        Response.Write "&nbsp;|&nbsp;"

        If abspage = 1 Then
        Response.Write "<span style=""color:silver;"">Previous Page</span>"
        Else
        Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & abspage - 1 & """>Previous Page</a>"
        End If
                Response.Write "&nbsp;|&nbsp;"

        If abspage < pagecnt Then
        Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & abspage + 1 & """>Next Page</a>"
        Else
        Response.Write "<span style=""color:silver;"">Next Page</span>"
        End If
        Response.Write "&nbsp;|&nbsp;"
        Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & pagecnt & """>Last Page</a>"
        Response.Write "</div>" & vbcrlf

    Else
      Response.Write "No records found!"
    End If

    rs.Close
    Set rs = Nothing
%>
</body>
</html>

Learning of our true origins.

I feel sorry:

http://www.infowars.com/articles/wor...eknowledge.htm

Foreknowledge of A Natural Disaster
Washington was aware that a deadly Tidal Wave was building up in the Indian Ocean
 
Old March 9th, 2005, 02:12 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

what line of code gives the error?
 
Old March 9th, 2005, 04:03 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

It says 'line 0'
But this might be the problem:
Code:
   <%  dim page
       dim i
' skip the dummy records
if not rs.eof then
rs.Move (page-1)*rs.pagesize
     ' Display the records
for i=1 to rs.pagesize
%>

<tr>
<td align=center BGCOLOR="#FFFFFF">
<%=rs("book")%>
</td>

<td nowrap align=center BGCOLOR="#FFFFFF">
<%=rs("chapter")%>
</td>

<td nowrap align=center BGCOLOR="#FFFFFF">
<%=rs("verse")%>
</td>
<td align=right BGCOLOR="#FFFFFF">
<%=rs("text_data")%>
<br>
</span>
</td>

 <td nowrap align=right BGCOLOR="#FFFFFF">

  <h4>Unicode</h4>
<textarea name="unic_area" rows="3" cols="16"
 class="onLoad" onmouseover="this.className='onMouseOver'"
 onmouseout="this.className='onMouseOut'">
 </textarea>

 </td>
</tr>
   <%rs.movenext
      ' Exit the loop when reaching the end of the recordset
If rs.EOF Then Exit For 'end if
next
end if%>
Learning of our true origins.

I feel sorry:

http://www.infowars.com/articles/wor...eknowledge.htm

Foreknowledge of A Natural Disaster
Washington was aware that a deadly Tidal Wave was building up in the Indian Ocean
 
Old March 9th, 2005, 07:07 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

line 0
but after working from the model code adding line by line when
Code:
   <%  dim page
       dim i
' skip the dummy records
if not rs.eof then
rs.Move (page-1)*rs.pagesize
     ' Display the records
for i=1 to rs.pagesize
%>
was added (or replaced), that's when the error showed up (even though it said line 0).
THe problem with the model code was that there was no SQL statement (SQL = "SELECT..."). So when framing a table there were too many for/while loops + IFs:
Code:
        If Not rs.EOF Then
            Response.Write "PageCount : " & rs.PageCount & "<br>" & vbcrlf
            Response.Write "Absolute Page : " & rs.AbsolutePage & "<br>" & vbcrlf

                Response.Write "Total number of records : " & rs.RecordCount & "<br><br>" & vbcrlf

                Dim fldF, intRec

                Response.Write "<table border=1 align=center cellpadding=3 cellspacing=0><thead><tr>"
                For Each fldF in rs.Fields
                    Response.Write "<td>" & fldF.Name & "</td>"
                Next
                Response.Write "</tr></thead><tbody>"

                For intRec=1 To rs.PageSize
                    If Not rs.EOF Then
                        Response.Write "<tr>"
                        For Each fldF in rs.Fields
                            Response.Write "<td>" & fldF.Value & "</td>"
                        Next
                        Response.Write "<tr>"
                        rs.MoveNext
                    End If
                Next
                Response.Write "</tbody></table><p>"
So I guess my question should be "How do you replace the table so that I can call as many fieldnames as I choose instead of everything?"

Learning of our true origins.

I feel sorry:

http://www.infowars.com/articles/wor...eknowledge.htm

Foreknowledge of A Natural Disaster
Washington was aware that a deadly Tidal Wave was building up in the Indian Ocean





Similar Threads
Thread Thread Starter Forum Replies Last Post
"Either BOF or EOF is True" need help! murshed Classic ASP Databases 4 March 18th, 2008 03:43 PM
Random record from objRS - why is EOF or BOF True? jfrizelle Classic ASP Databases 0 February 5th, 2008 07:24 AM
Re-try - BOF-EOF error JpaulH Access VBA 2 May 4th, 2006 02:16 PM
Access to Excel - BOF or EOF error JpaulH Access VBA 1 May 3rd, 2006 04:30 PM
RecordCount Query returns EOF and BOF jigs_bhavsar Pro VB Databases 3 November 11th, 2004 09:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.