Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Little More Help Please

    I keep getting this error message:

    ADODB.Field error '800a0bcd'

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

    /projectors/u2.asp, line 30



    Here is the code:


    Code:
    <%
    
    Response.Buffer = True
    
       ' Projector to retrieve
       Dim pName
          pName = Request.Form("ProjectorList1")
         Dim pName2
          pName2 = Request.Form("ProjectorList2") 
    
     '  If Len(ProjectorName) < 1 Then
     '     ProjectorName = NONE
    '   End If
    
    ' If Len(ProjectorName2) < 1 Then
     '     ProjectorName2 = NONE
     '  End If
    
    
       ' Connection string
          Dim connStr
            connStr = "dsn=mrres88d;uid=88klg;pwd=55666k;network=d4b876cn"
        
          ' Recordset object
          Dim rs
       Set rs = Server.CreateObject("ADODB.Recordset")
            
          rs.Open "select * from screenshots where ProjectorName = '" & replace(pName,"'","''") & "'", connStr, 3, 4
      
    pjProjectorName = rs("ProjectorName")
    pjAuthor = rs("Author")
    pjProjectorDescription = rs("ProjectorDescription")
    pjScreen = rs("Screen")
    pjFileName1 = rs("FileName1")
    pjFileName2 = rs("FileName2")
    pjFileName3 = rs("FileName3")
    pjFileName4 = rs("FileName4")
    
    %>
    <html>
    
    <head>
    <base target="contents">
    </head>
    
    <body topmargin="0" leftmargin="0" text="#000000" bgcolor="#FEE79E">
    
    <%
    rs.Close
    Set rs = Nothing
    
        Dim rs2
       Set rs2 = Server.CreateObject("ADODB.Recordset")
            
         rs2.Open "select * from screenshots where ProjectorName = '" & replace(pName2,"'","''") & "'", connStr, 3, 4
               
             
    %>
    
      <form method="POST" action="ProjectorsMain2.asp">
    <table border="1" width="772" height="118">
      <tr>
        <td width="399" height="12">
      <font size="1" face="Arial"><b>Projector:&nbsp; 
      <select size="1" name="ProjectorList1">
           <option selected><%= Response.Write(pjProjectorName)%></option>
         </select>
     
     </b></font></td>
        <td width="388" height="12"><font size="1" face="Arial"><b>Projector:&nbsp;
        <select size="1" name="ProjectorList2">
           <option selected><%= rs("ProjectorName2")%></option>
         </select> &nbsp; <input type="submit" value="Submit" name="B1"></form>
          </b></font>
    </td>
      </tr>
      <tr>
        <td width="399" height="67"><font size="1" face="Arial"><b>Author:&nbsp;<%= Response.Write(pjAuthor)%><br>
          Description:&nbsp;&nbsp;<%= Response.Write(pjProjectorDescription)%></b></font></td>
        <td width="388" height="67"><font size="1" face="Arial"><b>Author:&nbsp;<%= rs2("Author")%>
      <br>
          Description:&nbsp;&nbsp;<%= rs2("ProjectorDescription")%>
    </b></font></td>
      </tr>
      <tr>
        <td width="399" height="39"><b><font size="1" face="Arial">Screen:&nbsp;<%= Response.Write(pjScreen)%><span style="position: absolute; left: 207; top: 105"><a href="<%=Response.Write(pjFileName1)%>" target="contents"><img border="2" src="PICT0005_small1.JPG" alt="PICT0005.JPG (76099 bytes)" width="35" height="27"></a></span><span style="position: absolute; left: 253; top: 105"><a href="<%=Response.Write(pjFileName2)%>" target="contents"><img border="2" src="PICT0005_small1.JPG" alt="PICT0005.JPG (76099 bytes)" width="35" height="27"></a></span><span style="position: absolute; left: 342; top: 105"><a href="<%=Response.Write(pjFileName3)%>" target="contents"><img border="2" src="PICT0005_small1.JPG" alt="PICT0005.JPG (76099 bytes)" width="35" height="27"></a></span><br>
          Screenshots (click to enlarge)</font></b><span style="position: absolute; left: 298; top: 105"><b><font size="1" face="Arial"><a href="<%=Response.Write(pjFileName4)%>" target="contents"><img border="2" src="PICT0005_small1.JPG" alt="PICT0005.JPG (76099 bytes)" width="35" height="27"></a></font></b></span></td>
        <td width="388" height="39">
        <font size="1" face="Arial"><b>Screen:&nbsp;<%= rs2("Screen")%><span style="position: absolute; left: 592; top: 106"><a href="PICT0005.JPG" target="main"><img border="2" src="PICT0005_small1.JPG" alt="PICT0005.JPG (76099 bytes)" width="35" height="27"></a></span><br>
        Screenshots (click to enlarge)<span style="position: absolute; left: 635; top: 106"><a href="PICT0005.JPG" target="main"><img border="2" src="PICT0005_small1.JPG" alt="PICT0005.JPG (76099 bytes)" width="35" height="27"></a></span><span style="position: absolute; left: 723; top: 106"><a href="PICT0005.JPG" target="main"><img border="2" src="PICT0005_small1.JPG" alt="PICT0005.JPG (76099 bytes)" width="35" height="27"></a></span><span style="position: absolute; left: 679; top: 106"><a href="PICT0005.JPG" target="main"><img border="2" src="PICT0005_small1.JPG" alt="PICT0005.JPG (76099 bytes)" width="35" height="27"></a></span></b></font>
        </td>
      </tr>
    </table>
    
    
    </body>
    
    </html>
    
    <%
    
     rs2.Close
     Set rs2 = Nothing
     Set connStr = Nothing
     %>
    Again Any Help Is Appreciated

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    The error means that you access a field in the recordset when there is nothing in the recordset. So before you access a field, make sure that the recordset has records in it.
    Code:
    rs.Open "select * from screenshots where ProjectorName = '" & replace(pName,"'","''") & "'", connStr, 3, 4
     
    if not rs.BOF and not rs.EOF then 'there are records in the recordset
      pjProjectorName = rs("ProjectorName")
      pjAuthor = rs("Author")
      pjProjectorDescription = rs("ProjectorDescription")
      pjScreen = rs("Screen")
      pjFileName1 = rs("FileName1")
      pjFileName2 = rs("FileName2")
      pjFileName3 = rs("FileName3")
      pjFileName4 = rs("FileName4")
    else 'no records
      rs.Close
      Set rs = Nothing
      response.write "Record not found."
      response.end
    end if
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New Coder
    Join Date
    May 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Glen but the fields in this sql server database are all filled. I can't figure out why the message keeps poping up

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    Texas
    Posts
    287
    Thanks
    0
    Thanked 0 Times in 0 Posts
    1.) Make your sql a variable:
    sqlstring = "select * from screenshots where ProjectorName = '" and so forth.

    2.) response.write sqlstring
    response.end
    to see what you are actually sending the DB

    3.) If the sqlstring looks ok (all variables ok also)
    do the rs,open
    response.write rs.RecordCount
    response.end
    to see if you are acually returning anything

    THat is the starting point to tracking your problem down

    fv

  • #5
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Glens answer is what the error is telling you. Now, since you say there are records in the database you need to do a response.write on your SQL query and see what you come up with.
    Code:
    Response.write "select * from screenshots where ProjectorName = '" & replace(pName,"'","''") & "'"
    rs.Open "select * from screenshots where ProjectorName = '" & replace(pName,"'","''") & "'", connStr, 3, 4
     
    if not rs.BOF and not rs.EOF then 'there are records in the recordset
      pjProjectorName = rs("ProjectorName")
      pjAuthor = rs("Author")
      pjProjectorDescription = rs("ProjectorDescription")
      pjScreen = rs("Screen")
      pjFileName1 = rs("FileName1")
      pjFileName2 = rs("FileName2")
      pjFileName3 = rs("FileName3")
      pjFileName4 = rs("FileName4")
    else 'no records
      rs.Close
      Set rs = Nothing
      response.write "Record not found."
      response.end
    end if

  • #6
    New Coder
    Join Date
    May 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks everyone, I will try this advice in little while. I'm keeping an eye on Hurricane Francis (I live in Miami, Fl) and still doing some last minute preparation.

  • #7
    New Coder
    Join Date
    May 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I checked the sql and corrected the problem but I am still having a problem passing variables from a drop down menu (on one asp page) to the top (or banner) page of a frameset. I am still new to all this and perhaps I don't understand how the frameset works. The page at the top of the frameset is u2.asp and the frameset is ProjectorsMain2.asp The drop down menu is in a page called u.asp. Should action= (in the form in u.asp) be u2.asp, which will only call up that page and not the frameset or ProjectorsMain2.asp, which will call up the frameset but doesnt seem to work. I just get an error message in the top page (banner) in the frame set.

    This is the link to u.asp: http://greatad.com/projectors/u.asp I know that the code will work if I set action="u2.asp" in u.asp form, but the error message you see is when I set action="ProjectorsMain2.asp" in u.asp form. The error message you see is in the frame for u2.asp. Any ideas?
    Last edited by charlieb; 09-04-2004 at 07:27 AM.

  • #8
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    To do what you are trying to do requires that you pass the variable on to your u2.asp page. but if you do a response.write on each of the variables you will see that they are empty. Now one way to pass this on to the u2 page is to include the values inside the url. So make this change to your frames page ProjectorsMain2.asp
    Code:
    <%
    Dim pName, pName2
    pName = Request.Form("ProjectorList1")
    pName2 = Request.Form("ProjectorList2") 
    %>
    <frameset rows="145,*">
      <frame name="banner" scrolling="no" noresize target="contents" src="u2.asp?ProjectorList1=<%=pName%>&ProjectorList2=<%=pName2%>">
    Now since you are sending the variables in the url you need to change your u2.asp page accordingly.

    Code:
    Dim pName, pName2
    pName = Request.QueryString("ProjectorList1")
    pName2 = Request.QueryString("ProjectorList2")
    That should solve that problem for you. Now all you have to worry about is Frances.

  • #9
    New Coder
    Join Date
    May 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks I really appreciate all the great advice, I'll try that as soon as the power comes back on. I am using a computer at my dads' house. They are lucky enough to have power for the time being. This #%! hurricane is just hanging around and won't go away.

  • #10
    New Coder
    Join Date
    May 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Miranda, works like a charm!


  •  

    Posting Permissions

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