469,271 Members | 1,370 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

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

vikas251074
198 100+
Hello sir,
I am facing some problem for which I am trying hard to solve it. But in vain.
This programe is for View/Deletion. When I run program for first time, I select vlan from list and press Enter key, it display the details. Now when I again select vlan from list and press Enter key, following error occurs.
Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

I think error is in line no. 44. How to solve this problem?

Thanks and regards,
Vikas

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--#include file="style.css"-->
  3. <!--#include file="first.asp"-->
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7. <title>VLAN View/Deletion</title>
  8. <script type="text/javascript">
  9. function menu(){
  10.   window.location="menu.asp"
  11. }
  12. </script>
  13. </head>
  14. <body>
  15. <form name="myform" method="post" action="vlan_master_del.asp">
  16. <div id="myDiv" style="position:absolute; top:150px; left:200px; width:600px; height:500px">
  17. <%
  18. set conn = server.createobject("ADODB.Connection")
  19. set rs = server.createobject("ADODB.Recordset")
  20. conn.open "Provider=MSDAORA.1; dsn=ipis; Password=ipis; User Id=ipis; Data Source=isap2000; Persist Security Info=True"
  21. %>
  22. <h2><center>VLAN Master View/Deletion</center></h2>
  23. <table align="center">
  24.   <tr>
  25.     <td>Select a VLAN : </td>
  26.     <td>
  27.       <select name="vlan_name">
  28. <%        set rs = conn.execute("select vlan_name from vlan_master order by vlan_name")
  29.         do while not rs.eof %>
  30. <%        if not isempty(request.form("submit")) and request.form("vlan_name")=rs("vlan_name") then %>
  31.             <option value="<%=rs("vlan_name")%>" selected><%=rs("vlan_name")%></option>
  32. <%        else %>
  33.             <option value="<%=rs("vlan_name")%>"><%=rs("vlan_name")%></option>
  34. <%        end if
  35.         rs.movenext
  36.         loop %>
  37.       </select>
  38.     </td>
  39.     <td><input type="submit" style="width:100px " name="submit" value="Generate"/></td>
  40.   </tr>
  41. </table>
  42. <% if not isempty(request.form("submit")) then 
  43.   v_vlan_name = trim(request.form("vlan_name"))
  44.   set rs = conn.execute("select vlan_name, first_ip, last_ip, subnet_mask, router, network_switch, camera, printer, server, ip_phone, pc from vlan_master where vlan_name = '"&v_vlan_name&"'")
  45. %>
  46.   <table align="center" border="1">
  47.     <tr>
  48.       <td>
  49.         <table>
  50.           <tr>
  51.             <td align="right" style="width:125px ">VLAN Name :</td>
  52.             <td>
  53.               <input type="text" style="width:250px " name="vlan_name" value="<%=rs("vlan_name")%>"/>
  54.             </td>
  55.           </tr>
  56.           <tr>
  57.             <td align="right" style="width:125px ">VLAN First IP :</td>
  58.             <td align="left">
  59.               <input type="text" style="width:100px " name="first_ip" value="<%=rs("first_ip")%>"/>
  60.             </td>
  61.           </tr>
  62.           <tr>
  63.             <td align="right" style="width:125px ">VLAN Last IP :</td>
  64.             <td align="left">
  65.               <input type="text" style="width:100px " name="last_ip" value="<%=rs("last_ip")%>"/>
  66.             </td>
  67.           </tr>
  68.           <tr>
  69.             <td align="right" style="width:125px ">VLAN Subnet Mask :</td>
  70.             <td align="left">
  71.               <input type="text" style="width:100px " name="subnet_mask" value="<%=rs("subnet_mask")%>"/>
  72.             </td>
  73.           </tr>
  74.         </table>
  75.       </td>
  76.     </tr>
  77.     <tr>
  78.       <td>
  79.         <table>
  80.           <tr>
  81.             <td align="right" style="width:125px ">Router :</td>
  82.             <td align="left"><input type="text" style="width:50px " name="router" value="<%=rs("router")%>"/></td>
  83.             <td align="right" style="width:125px ">Switch :</td>
  84.             <td align="left"><input type="text" style="width:50px " name="network_switch" value="<%=rs("network_switch")%>"/></td>
  85.           </tr>
  86.           <tr>
  87.             <td align="right" style="width:125px ">Camera :</td>
  88.             <td align="left"><input type="text" style="width:50px " name="camera" value="<%=rs("camera")%>"/></td>
  89.             <td align="right" style="width:125px ">Printer :</td>
  90.             <td align="left"><input type="text" style="width:50px " name="printer" value="<%=rs("printer")%>"/></td>
  91.           </tr>
  92.           <tr>
  93.             <td align="right" style="width:125px ">Server :</td>
  94.             <td align="left"><input type="text" style="width:50px " name="server" value="<%=rs("server")%>"/></td>
  95.             <td align="right" style="width:125px ">IP Phone :</td>
  96.             <td align="left"><input type="text" style="width:50px " name="ip_phone" value="<%=rs("ip_phone")%>"/></td>
  97.           </tr>
  98.           <tr>
  99.             <td align="right" style="width:125px ">PC :</td>
  100.             <td align="left"><input type="text" style="width:50px " name="pc" value="<%=rs("PC")%>"/></td>
  101.           </tr>
  102.         </table>
  103.       </td>
  104.     </tr>
  105.     <tr>
  106.       <td>
  107.         <table align="center">
  108.           <tr>
  109.             <td><input type="button" name="back" value="Back" style="width:100px" onclick="menu();"/></td>
  110.             <td><input type="button" name="delete1" value="Delete" style="width:100px"/></td>
  111.           </tr>
  112.         </table>
  113.       </td>
  114.     </tr>
  115.   </table>
  116. <% end if %>
  117. </div>
  118. </form>
  119. </body>
  120. </html>
Jun 17 '08 #1
1 2704
idsanjeev
241 100+
hello vikas
plz modify your code with this modified code from line 23 to 45
Expand|Select|Wrap|Line Numbers
  1. <table align="center">
  2.   <tr>
  3.     <td>Select a VLAN : </td>
  4.     <td>
  5.             <select Id="vlan_name" Name="vlan_name" onChange="this.form.submit();">
  6.  
  7.  
  8.         <option value="">[Select Vlane]</option>
  9.         <%set rs = conn.execute("select vlan_name from vlan_master order by vlan_name")%>
  10.  
  11.             <% while not rs.eof %>
  12.         <option value=<%=rs("vlan_name")%> ><%=rs("vlan_name")%></option>
  13.         </option>
  14.  
  15.             <%
  16.             rs.movenext
  17.             wend
  18.             rs.close
  19. %>
  20.       </select>
  21.     </td>
  22.     <td><input type="submit" style="width:100px " name="submit" value="Generate"/></td>
  23.   </tr>
  24. </table>
  25. <% v_vlan_name=Request.Form("vlan_name")
  26.  
  27.   set rs = conn.execute("select vlan_name, first_ip, last_ip, subnet_mask, router, network_switch, camera, printer, server, ip_phone, pc from vlan_master where vlan_name = '"&v_vlan_name&"'")
  28.   if Rs.eof=true then
  29.   response.Write "Nothing to Display"
  30.   else
  31. %>
let us know what happens
Regards
Jha
Jun 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.