SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    730
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Either BOF or EOF is True, or the current record has been deleted

    Howcome it doesn't work?


    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%>
    <!--#include file="gemetria2.asp"-->        
            <%Dim fldF, intRec%>
            
    
    <form name="conv_form">
    <table border="1" cellspacing="1" bgcolor="#0066CC">
    <tr style="height:12.75pt">
    
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Book<br></font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Chapter<br></font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Verse<br></font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Text</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Text in Hebrew</font></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"><font face="BSTHebrew">
    <font size='2' face="Verdana">
      <h4>Unicode</h4>
    <textarea name="unic_area" rows="3" cols="16"
     class="onLoad" onmouseover="this.className='onMouseOver'"
     onmouseout="this.className='onMouseOut'">
     </textarea>
    </font>
     </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>
    Compare bible texts (and other tools):
    TheWheelofGod

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,263
    Mentioned
    115 Post(s)
    Tagged
    1 Thread(s)
    line 0? You can't have a line zero....
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  3. #3
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Kingston
    Posts
    246
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's in gemetria2.asp? Does it have any data retrieval or recordset code in it?

  4. #4
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    730
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    no query in gemetria3

    Quote Originally Posted by ole dawg
    What's in gemetria2.asp? Does it have any data retrieval or recordset code in it?
    No it doesn't
    Compare bible texts (and other tools):
    TheWheelofGod

  5. #5
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    730
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    THis might be the problem:

    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?"
    Last edited by gilgalbiblewheel; Mar 9, 2005 at 17:30. Reason: New question added at the end
    Compare bible texts (and other tools):
    TheWheelofGod

  6. #6
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    IL
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is just an extremely noob guess, cause I have no idea what's going on here and am just scratching the surface on this eof bof thing. Can't you do something like this
    Code:
    If Not rs.EOF AND Not rs.BOF Then
    Response.Write ""
    Else
    'put your entire page here
    End If
    What does EOF and BOF stand for anyway?

  7. #7
    SitePoint Enthusiast team_ecommerce's Avatar
    Join Date
    Feb 2005
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    That error occurs when you try to access a record when the record pointer is at the End Of File (EOF) already. To avoid that, make sure that you test first if the pointer is at EOF before fetching a row.

    Ex.
    'Open table part here yada yada...
    IF NOT MY_RECORDSET.EOF THEN
    ' do a data access command here like response.write MY_RECORDSET("COLUMN1")
    ELSE
    response.write "Error. You are at the End Of File"
    END IF


    Makes sense?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •