Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Thanked 0 Times in 0 Posts

    ADODB.Recordset (0x800A0BCD)

    This is my error

    Well actually you can see it in action at http://www.paintballerschoice.com/ma...sp?intProdId=1
    When you click on the bottom to go to the second page, I get this error

    It tell me that the error in on line 82, but It should not be, since the information from the database is already had been displayed, it just give me that error on the second page. Also if I replace the requestquery(int***) with an actuall variable such as 1, then I dont get the error.

    Thank you for the help.

    HTTP 500.100 - Internal Server Error - ASP error
    Internet Information Services


    Technical Information (for support personnel)

    Error Type:
    ADODB.Recordset (0x800A0BCD)
    Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
    /paintballerschoice/master_forms/markerlist.asp, line 82

    Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

    GET /paintballerschoice/manufac_marker.asp

    Here is my code for this page, Its in two parts,

    Main Page

    <%@ Language=VBScript %>
    <% Option Explicit %>
    <!-- #include file="adovbs.inc" -->
    <!-- #include file="db.asp" -->
    'One Mind Corporation Paintballers Choice.com
    'Name Variable
    dim intCatID

    'Declare Variable
    intCatID =Request.QueryString("intProdId")
    'intCatID = 1

    <html lang="en-US">
    <title>Paintball Markers -PaintballersChoice.com</title>
    <meta name="keywords" content="Paintball Markers,Paintball Markers Paintball gun">
    <meta name="description" content="List all of the current Paintball Markers in the market">
    <meta name="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <link rel="stylesheet" href="include/cart_stylesheet.css" type="text/css">
    <script src="include/paintballerschoice.js" language="JavaScript" TYPE="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css"> </style>
    <table width="760" border="0" cellpadding="0" cellspacing="1">
    <td><!-- #include file="master_forms/Header.asp" -->
    <!-- #include file="master_forms/menubar.asp" -->

    <table width="760" border="1" cellpadding="1" cellspacing="-1" bordercolor="#FFFFFF">
    <td width="17%" align="left" valign="top"><!--#include file="master_forms/left.asp"--></td>
    <td width="66%" align="left" valign="top" bordercolor="#FFFFFF"><!--#include file="master_forms/markerlist.asp"--></td>
    <td width="17%" align="center" valign="top" bgcolor="#FFFFFF"><!-- #include file="master_forms/right.asp" --></td>

    <table width="760" border="0" cellspacing="1" cellpadding="1">
    <td><!--#include file="master_forms/footer.asp" --></td>


    Second Page Where most of the code is

    <%' Marker Information ID

    '********************************* Catalog Table Code ********************************************
    Dim Conn
    ' Data source specific vars
    Dim rsProdInfo
    'Const adVarChar = 200
    'Const adInteger = 3
    'Const adDate = 7

    ' Table Building Vars
    Dim intTableWidth, intTableHeight
    Dim intWidthLooper, intHeightLooper
    Dim strSQL 'SQL command

    Dim intPageCount
    Dim intCurrentPage
    'dim intCatID
    Dim blnOutOfData
    Dim I
    'Dim Conn
    'intCatID =Request.QueryString("intProdId")
    ' this will open the connection
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open ConString

    ' the query information
    ' Build SQL String using the parameters
    strSQL = "SELECT markerid,image,image_small,bps,image_name,nameofwebpage,manufacture,manufac_id,name,msrp FROM tbl_marker WHERE manufac_id = '"&intCatID&"'"
    'strSQL = "SELECT * FROM tbl_marker WHERE manufac_id = 1"

    ' Read in parameters + set defaults if none entered.
    ' You could save chosen values to a DB or cookies or whatever, but it
    ' all sort of depends on what you're using the script for.
    intTableWidth = CInt(Request.QueryString("width"))
    If intTableWidth <= 0 Then intTableWidth = 2

    intTableHeight = CInt(Request.QueryString("height"))
    If intTableHeight <= 0 Then intTableHeight = 7

    intCurrentPage = CInt(Request.QueryString("page"))

    ' Make up some sample data to display. I'm using an in-memory recordset
    ' simply to keep things fast and because I assume most users will be using
    ' this script with some sort of database. This way you should just be
    ' able to drop in your own DB code and edit the display section and you
    ' should have everything working pretty quickly.
    'Set rstTableData = Server.CreateObject("ADODB.Recordset")
    Set rsProdInfo = Server.CreateObject("ADODB.Recordset")

    rsProdInfo.Fields.Append "id", adInteger
    'rsProdInfo.fields.append "manufac_id", adInteger
    rsProdInfo.Fields.Append "title", adVarChar, 25
    rsProdInfo.Fields.Append "description", adVarChar, 255

    rsProdInfo.Fields.Append "image", adVarChar, 255


    rsProdInfo.Open strSQL, Conn, adOpenStatic, adLockReadOnly, adCmdText

    'this will Correct for error on page when there are no records.

    ' Display table using paramerers for table size and page # and using data from recordset.

    ' Calculate # of pages - Divide items by page size and find the next largest whole number.
    intPageCount = -(Int(-(rsProdInfo.RecordCount / (intTableWidth * intTableHeight))))
    ' Sorry for the above line... it doesn't make much logical sense, but it was the easiest
    ' one line implementation I could come up with. There must be a more logical one...
    ' and no it's not Int(...) + 1

    ' If page size is larger then # of records, reset page count to 1
    If intTableWidth * intTableHeight >= rsProdInfo.RecordCount Then intPageCount = 1

    ' If current page falls outside acceptable range, default to page 1
    If 0 >= intCurrentPage Or intCurrentPage > intPageCount Then intCurrentPage = 1

    ' Move into recordset the appropriate number of pages
    rsProdInfo.Move (intCurrentPage - 1) * (intTableWidth * intTableHeight)

    ' Show our table
    Response.Write "<table width=""100%"" border=""0""cellspacing=""6"" cellpadding=""6"">" & vbCrLf
    For intHeightLooper = 1 To intTableHeight
    If Not rsProdInfo.EOF Then
    Response.Write "<tr valign=""top"" align=""center"">" & vbCrLf
    For intWidthLooper = 1 to intTableWidth
    If Not rsProdInfo.EOF Then
    Response.Write vbTab & "<td>"

    <font color="#000000" face="time new roman" size="1">
    <a style="color:#000000; text-decoration:none" href="<%=rsProdInfo("nameofwebpage")%>">
    <img src="<%=rsProdInfo("image_small")%>" border="0" alt="<%=rsProdInfo("image_name")%>"> </a><br>
    BPS <%=rsProdInfo("bps")%><br>
    MSRP $<%=rsProdInfo("msrp")%><br>
    Response.Write "</td>"
    ' Out of data... bail out of cells early!
    blnOutOfData = True
    Exit For
    End If

    ' Clean up odd table cells if any and bail out of rows!
    If blnOutOfData Then
    If rsProdInfo.RecordCount Mod intTableWidth > 0 And intHeightLooper > 1 Then
    For I = (rsProdInfo.RecordCount Mod intTableWidth) + 1 To intTableWidth
    Response.Write "<td>&nbsp;</td>" & vbCrLf
    Next ' I
    End If
    Response.Write "</tr>" & vbCrLf
    Exit For
    End If

    Response.Write "</tr>" & vbCrLf
    End If
    Next ' intHeightLooper
    Response.Write "</table>" & vbCrLf

    response.Write "<font color='#000000' face='time new roman' size='1'>"
    ' Show paging indicator if multiple pages:
    If intTableWidth * intTableHeight < rsProdInfo.RecordCount Then
    Response.Write "Pages:&nbsp;"

    If intCurrentPage > 1 Then
    Response.Write "<a href=""?width=" & intTableWidth & "&height=" & intTableHeight & "&page=" & intCurrentPage - 1 & """>[&lt;&lt; Prev]</a>&nbsp;"
    End If

    ' You can also show page numbers:
    For I = 1 To intPageCount
    If I = intCurrentPage Then
    Response.Write I & "&nbsp;"
    Response.Write "<a href=""?width=" & intTableWidth & "&height=" & intTableHeight & "&page=" & I & """>" & I & "</a>&nbsp;"
    End If
    Next 'I

    If intCurrentPage < intPageCount Then
    Response.Write "<a href=""?width=" & intTableWidth & "&height=" & intTableHeight & "&page=" & intCurrentPage + 1 & """>[Next &gt;&gt;]</a>"
    End If
    End If

    response.Write "</font>"

    ' Close down RS
    Set rsProdInfo = Nothing

    '********************************* End Of Code **************************************************
    Last edited by Memito; 05-04-2005 at 05:21 AM.

  2. #2
    Regular Coder
    Join Date
    Apr 2005
    Lisbon, CT
    Thanked 0 Times in 0 Posts
    Response.Write "<a href=""?width=" & intTableWidth & "&height=" & intTableHeight & "&page=" & intCurrentPage + 1 & """>[Next &gt;&gt;]</a>"

    The data being passed doesn't seem to coincide with your request.querystring.


  3. #3
    Regular Coder
    Join Date
    Aug 2002
    Thanked 2 Times in 2 Posts
    And here's a related article:

    Why do I get 'BOF or EOF' errors?
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


Posting Permissions

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