By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

Error Type: ADODB.Recordset (0x800A0E7D)

P: 67
Hi Friends!

Please Help me! How i can solve this error? Please explain me, what is the error and how to solve?

Expand|Select|Wrap|Line Numbers
  1. Error Type:
  2. ADODB.Recordset (0x800A0E7D)
  3. The connection cannot be used to perform this operation. It is either closed or invalid in this context.
  4. /H3finalresult/include/accept_reject2.asp, line 18
  5.  
connection.asp

Expand|Select|Wrap|Line Numbers
  1. <%    
  2.     const TBL_Data = "tbl_data"
  3.     const TBL_H3Appr = "tbl_H3Approved"
  4.     const TBL_H3Selec = "tbl_H3Selected"
  5.     const TFL_H3SelecID = "IDNO"
  6.     const TFL_H3IDNO = "IDNO"
  7.     const TFL_IDNO = "IDNO"
  8.     const TFL_DOB = "DOB"
  9.  
  10.     const DB_NAME = "DataBase/H3OnlineApp.mdb"
  11.     mdb_path = pathdefiner & DB_NAME
  12.     set my_Conn = Server.CreateObject("ADODB.Connection")
  13.     my_Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb_path)
  14. %>
  15.  
accept_reject2.asp

Expand|Select|Wrap|Line Numbers
  1. <%pathdefiner="../"%>
  2. <!-- #include file="../Connection/connector.asp" -->
  3. <!--#include file="declareVariables.asp" -->
  4. <!--#include file="RetrieveSubj2.asp" -->
  5. <!--#include file="../MainMenu/Header.htm" -->
  6.  
  7. <%
  8. dim rsSql,rsctSql
  9. dim a
  10. dim ctstatus
  11.  
  12.     Set rs = Server.CreateObject("ADODB.Recordset")
  13.     Set rs.ActiveConnection = my_Conn
  14.  
  15. rsSql= "SELECT * FROM " & TBL_H3Appr &" where "& TFL_H3IDNO & "='" & Session.Contents("IDNO") & "';"
  16.  
  17. rs.Source = rsSql
  18. rs.Open ------ line 18
  19.  
  20. WHILE NOT rs.EOF
  21.  
  22. %>
  23.  
  24. <form id="frmUpdate" name="frmUpdate" method="post" action="Updatesubj2.asp">
  25.   <p align="center">&nbsp;</p>
  26.   <div align="center">
  27.     <table width="522" border="0" cellspacing="0" cellpadding="0">
  28.      <tr>
  29.         <td><p>You are allowed to offer
  30.             <input name="txt_Num_H3_Approved" type="text" id="txt_Num_H3_Approved" value="<% = rs("Num_H3_Approved")%>" size="3" readonly>
  31. H3 Subject(s)</p>
  32.         <p>&nbsp;</p></td>
  33.       </tr>
  34.       <tr>
  35.         <td>
  36.         <%uni1 = RetrieveApp(0)%>
  37.         <%if(StrComp(uni1,"off1")=0)then%><label>
  38.         <input type="checkbox" name="chk_Offer_2H3_Subject" id="chk2" onClick="javascript:Onchecked('chk2','SPAN_Onchecksubj','Offer 2H3 subjects'),disablechk2();" value="Offer 2H3 subjects" checked>
  39. I will offer the following TWO subjects.</label>
  40.         <%else%>
  41.           <label> <input type="checkbox" name="chk_Offer_2H3_Subject" id="chk2" onClick="javascript:Onchecked('chk2','SPAN_Onchecksubj','Offer 2H3 subjects'),disablechk2();" value="Offer 2H3 subjects" > 
  42.           I will offer the following TWO subjects.</label>
  43.           <%End if%></td>
  44.       </tr>
  45.       <tr>
  46.         <td>
  47.         <%uni2 = RetrieveApp(1)%>
  48.         <%if(StrComp(uni2,"off1")=0)then%><label>
  49.           <input type="checkbox" name="chk_Offer_1H3_Subject" id="chk1" onClick="javascript:Onchecked('chk1','SPAN_Onchecksubj','Offer 1H3 subject'),disablechk1();" value="Offer 1H3 subject" checked> 
  50.           I will offer the following ONE subject.</label>
  51.           <%else%>
  52.           <label> <input type="checkbox" name="chk_Offer_1H3_Subject" id="chk1" onClick="javascript:Onchecked('chk1','SPAN_Onchecksubj','Offer 1H3 subject'),disablechk1();" value="Offer 1H3 subject" > 
  53.           I will offer the following ONE subject.</label>
  54.           <%End if%>          </td>
  55.       </tr>
  56.       <tr>
  57.         <td><label>
  58.         <%uni3 = RetrieveApp(2)%>
  59.         <%if(StrComp(uni3,"off1")=0)then%>
  60.           <input type="checkbox" name="chk_Decided_Not" id="chk0" onClick="javascript:Ondecidchecked(),disablechk0();" value="Decided not to offer any H3" checked >
  61.         I have decided NOT to offer any H3 subject(s).<br>
  62.         </label>
  63.         <%else%>
  64.           <label> <input type="checkbox" name="chk_Decided_Not" id="chk0" onClick="javascript:Ondecidchecked(),disablechk0();" value="Decided not to offer any H3" > I have decided NOT to offer any H3 subject(s).</label>
  65.           <%End if%></td>
  66.       </tr>
  67.       <tr>
  68.         <td>
  69.         <span id="SPAN_decidsubj"></span>
  70.         <span id="SPAN_Onchecksubj">
  71.         <table width="404" border="0" cellspacing="0" cellpadding="0">
  72.      <%
  73.      if rs("MOE_Approved1") =  "NIL" then
  74.         else
  75.         %>
  76.       <tr>
  77.         <td><strong>I will offer the following subject(s):</strong></td>
  78.       </tr>
  79.       <tr>
  80.         <td width="399"><label>
  81.         <%uni4 = RetrieveApp(3)%>
  82.         <%if(StrComp(uni4,"Moe1")=0)then%>
  83.           <label> <input type="checkbox" name="chk_MOE_Approved1" id="chk" onClick="return myFunction()" value="<% = rs("MOE_Approved1")%>" checked > MOE &nbsp; &nbsp; <% = rs("MOE_Approved1")%> </label>
  84.           <%else%>
  85.           <label> <input type="checkbox" name="chk_MOE_Approved1" id="chk" onClick="return myFunction()" value="<% = rs("MOE_Approved1")%>" > MOE &nbsp; &nbsp; <% = rs("MOE_Approved1")%> </label>
  86.           <%End if%>
  87.         </label></td>
  88.       </tr>
  89.       <% end if 
  90.        if rs("MOE_Approved2") =  "NIL" then
  91.         else
  92.        %>
  93.       <tr><td width="399"><label>
  94.       <%uni5 = RetrieveApp(4)%>
  95.       <%if(StrComp(uni5,"Moe2")=0)then%>
  96.       <label> <input type="checkbox" name="chk_MOE_Approved2" id="chk" onClick="return myFunction()" value="<% = rs("MOE_Approved2")%>" checked >  MOE &nbsp; &nbsp; <% = rs("MOE_Approved2")%> </label>
  97.       <%else%>
  98.       <label> <input type="checkbox" name="chk_MOE_Approved2" id="chk" onClick="return myFunction()" value="<% = rs("MOE_Approved2")%>"   >  MOE &nbsp; &nbsp; <% = rs("MOE_Approved2")%> </label>
  99.       <%End if%>
  100.         </label></td>
  101.       </tr>
  102.       <% end if 
  103.        if rs("MOE_Approved3") =  "NIL" then
  104.         else
  105.        %>
  106.       <tr><td width="399"><label>
  107.       <%uni6 = RetrieveApp(5)%>
  108.       <%if(StrComp(uni6,"Moe3")=0)then%>
  109.         <label> <input type="checkbox" name="chk_MOE_Approved3" id="chk" onClick="return myFunction()" value="<% = rs("MOE_Approved3")%>" checked > MOE &nbsp; &nbsp; <% = rs("MOE_Approved3")%> </label>
  110.         <%else%>
  111.          <label> <input type="checkbox" name="chk_MOE_Approved3" id="chk" onClick="return myFunction()" value="<% = rs("MOE_Approved3")%>"  > MOE &nbsp; &nbsp; <% = rs("MOE_Approved3")%> </label>
  112.         <%End if%>
  113.         </label></td>
  114.       </tr>
  115.       <% 
  116.     end if  // moe end if
  117.     //-------------- Nus ---------------------//
  118.            if rs("NUS_Approved") =  "NIL" then
  119.         else    
  120.         %>
  121.       <tr>
  122.         <td width="399"><label>
  123.         <%uni7 = RetrieveApp(6)%>
  124.         <%if(StrComp(uni7,"Nus")=0)then%>
  125.         <label> <input type="checkbox" name="chk_NUS_Approved" id="chk" onClick="return myFunction()" value="<% = rs("NUS_Approved")%>" checked > NUS &nbsp; &nbsp; &nbsp;<% = rs("NUS_Approved")%> </label>
  126.         <%else%>
  127.          <label> <input type="checkbox" name="chk_NUS_Approved" id="chk" onClick="return myFunction()" value="<% = rs("NUS_Approved")%>" > NUS &nbsp; &nbsp; &nbsp;<% = rs("NUS_Approved")%> </label>
  128.         <%End if%>
  129.         </label></td>
  130.       </tr>
  131.     <% 
  132.     end if  // Nus end if
  133.  
  134.     //-------------- Ntu ---------------------//
  135.            if rs("NTU_Approved") =  "NIL" then
  136.         else    
  137.         %>
  138.       <tr>
  139.         <td width="399"><label>
  140.         <%uni8 = RetrieveApp(7)%>
  141.          <%if(StrComp(uni8,"Ntu")=0)then%>
  142.         <label> <input type="checkbox" name="chk_NTU_Approved" id="chk" onClick="return myFunction()" value="<% = rs("NTU_Approved")%>" checked > NTU &nbsp; &nbsp; &nbsp;<% = rs("NTU_Approved")%> </label>
  143.         <%else%>
  144.          <label> <input type="checkbox" name="chk_NTU_Approved" id="chk" onClick="return myFunction()" value="<% = rs("NTU_Approved")%>"  > NTU &nbsp; &nbsp; &nbsp;<% = rs("NTU_Approved")%> </label>
  145.         <%End if%>
  146.         </label></td>
  147.       </tr>
  148.       <% 
  149.     end if  // ntu end if
  150.     //-------------- Smu ---------------------//
  151.            if rs("SMU_Approved") =  "NIL" then
  152.         else    
  153.         %>
  154.       <tr>
  155.         <td width="399"><label>
  156.         <%uni9 = RetrieveApp(8)%>
  157.         <%if(StrComp(uni9,"Smu")=0)then%>
  158.         <label> <input type="checkbox" name="chk_SMU_Approved" id="chk" onClick="return myFunction()" value="<% = rs("SMU_Approved")%>" checked  > SMU &nbsp; &nbsp; &nbsp;<% = rs("SMU_Approved")%> </label>
  159.         <%else%>
  160.          <label> <input type="checkbox" name="chk_SMU_Approved" id="chk" onClick="return myFunction()" value="<% = rs("SMU_Approved")%>"  > SMU &nbsp; &nbsp; <% = rs("SMU_Approved")%> </label>
  161.         <%End if%>
  162.         </label></td>
  163.       </tr>
  164.  
  165.       <% 
  166.     end if
  167.  
  168.  rs.MoveNext
  169.  WEND
  170.     rs.Close
  171.     my_Conn.Close
  172.     set rs=nothing
  173.     set my_Conn=nothing
  174.     Response.Expires = -1 
  175.  
  176. %>
  177. <span id="SPAN_selectSubj"></span>
  178.     </table></span>
  179.         </td>
  180.       </tr>
  181.     </table>
  182.  
  183.   </div>
  184.   <p align="center">
  185.     <input type="submit" name="Submit" id="submit" value="submit" onClick="">
  186.   </p>
  187.   </label>
  188. </form>
  189. <!--#include file="../MainMenu/Footer.htm" -->
  190. <script>
  191.     setupScript();
  192. </script>
  193.  
Thanks and Regards,
Susan
Nov 6 '08 #1
Share this Question
Share on Google+
1 Reply


DrBunchman
Expert 100+
P: 979
Hi Susan,

What happens if you take the contents of your include file Connector.asp and paste it directly into your code (not forgetting to remove the include statement) - does it work then?

Dr B
Nov 6 '08 #2

Post your reply

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