Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    494

    Unanswered: 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>

  2. #2
    Join Date
    Jul 2004
    Posts
    494

    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"><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%>

Posting Permissions

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