Jump to content

Script error -


Guest drunyan

Recommended Posts

Guest drunyan

I am brand new to scripting and this is my first page - I've been working on this for most of the evening and thought I'd ask for help.I get the following error message: ADODB.Recordset error '800a0e79' Operation is not allowed when the object is open. /Members/setup/add_department.asp, line 143Here is my HTML contents:<html><script language="VBscript"></script> <head> <title>Sign Up</title> </head> <!--#include file = "../../global.inc"--> <body topmargin="0" leftmargin="0"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td id="headerBox"><!-- Header Graphics --> <!--webbot bot="Include" U-Include="../../Menus/MemberHeader.htm"--> <a name="top"></a> <table border="0" cellpadding="0" cellspacing="0" width="800"> <tr> <td id="headerBox" width="799"> <!-- Header Graphics --> <table border="0" cellpadding="0" cellspacing="0" width="760"> </table> <hr color="#000080"> <p><img border="0" src="../../images/newmem2.gif"><font face="Arial" size="2">Outreach 28 is designed on departments completing events.  Once your departments are set-up you will complete the event associated with each department.  Then you will map on which day each event is to be completed.  Listed at the bottom of the page are default departments and default events you can edit or delete. </font></p> </td> </tr></table><table width="745"><form name="frm" method="post" action=""> <tr> <td colSpan="6" width="1526"> <h3 align="center"><font color="#000080" face="Arial">Department Information</font></h3> </td> </tr> <tr> <td width="4"><font face="Arial"> </font></td> <td width="127" align="right"><font face="Arial" size="2">Department Name:</font></td> <td width="220"><font face="Arial"> <input maxLength="50" name="Dept_Name" size="30"></font></td> <td width="1"></td> <td width="178" align="right"><font face="Arial" size="2">Department Description:</font></td> <td width="169"><font face="Arial"> <input maxLength="50" name="Dept_Desc" size="30"></font></td> </tr> <tr> <td width="4"><font face="Arial"> </font></td> <td width="127" align="right"><font face="Arial" size="2">Coordinator's Name:</font></td> <td width="220"><select name="Dept_Coord" size="1"> <% Response.Buffer=True select_sql2="SELECT Member_FName, Member_LName FROM Tbl_Member WHERE Church_ID = '"&session("Church_ID")&"'" conn.open connect_string Rs.open select_sql2, connect_string conn.Execute(select_sql2)%><option>Please select a member</option> <% While Not rs.EOF %><option><%=Response.Write(Rs("Member_Fname") & " " & Rs("Member_LName")) %></option> <% rs.movenext %> <% Wend %><% conn.close %> </select></td> <td width="1"></td> <td width="537" colspan="2"><font face="Arial" size="2" color="#008000"><a href="http://">Add Events for this Department</a></font></td> </tr> <tr> <td align="right" colSpan="6" width="1526"> <p align="center"> </td> </tr> <tr> <td align="right" colSpan="6" width="1526"> <p align="left"> <input type="submit" name="btnSave" value="Save Department Information"> <input type="submit" name="btnBack" value="<< Back"> <input type="submit" name="btnNext" value="Next >>" onclick="NextClicked();" tabindex="12"> <input type="button" name="btnCancel" value="Cancel"> <% Response.Buffer=True select_sql="SELECT Dept_Name, Dept_Desc, Dept_Coord FROM Tbl_Dept WHERE Church_ID = '"&session("Church_ID")&"'" conn.open connect_string Rs.open select_sql, connect_string conn.Execute(select_sql) 'conn.close 'set conn=nothing %><% Dept_Name=Request.Form("Dept_Name")Dept_Desc=Request.Form("Dept_Desc")Dept_Coord=Request.Form("Dept_Coord")status=Request.Form("Status")submit_button=Request.Form("btnSave")next_button=Request.Form("btnNext")back_button=Request.Form("btnBack")dim insert_sqlinsert_sql="INSERT INTO tbl_Dept (Dept_Name, Dept_Desc, Dept_Coord, Church_ID) VALUES ('"&Dept_Name&"', '"&Dept_Desc&"', '"&Dept_Coord&"', '"&session("Church_ID")&"')"Response.write(submit_button)if submit_button = "Save Department Information" then conn.open connect_string Response.write(insert_sql) conn.Execute(insert_sql) 'conn.close set conn=nothing response.redirect("../setup/add_department.asp") end ifif next_button = "Next >>" thenResponse.Redirect("../setup/newworker.asp")end ifif back_button = "<< Back" thenResponse.Redirect("../setup/newmember.asp")end if%><!----------- This page goes to newdirector next-------------- -------> <!-- Include File = "../processfiles/printvariables.asp"--> <!----------- END PAGE CONTENTS---------------------> </td> </tr></table><p><u><font face="Arial" color="#000080"><b>Current Departments</b></font></u></p><table border="0" width="95%"> <tr> <td width="4%" bgcolor="#000080"> </td> <td width="3%" bgcolor="#000080"> </td> <td width="15%" bgcolor="#000080" align="center"><font color="#FFFFFF" face="Arial" size="1"><b>Department Name</b></font></td> <td width="11%" bgcolor="#000080" align="center"><font color="#FFFFFF" face="Arial" size="1"><b>Coordinator's Name</b></font></td> <td width="26%" bgcolor="#000080" align="center"><b> <font face="Arial" size="1" color="#FFFFFF">Department Description</font></b></td> </tr> <% While Not rs.EOF %> <tr> <td width="4%" bgcolor="#FFFFFF"><font color="#008000" size="2">Edit</font></td> <td width="3%" bgcolor="#FFFFFF"><font color="#008000" size="2">Delete</font></td> <td width="15%" bgcolor="#FFFFFF" align="center"><font color="#08399C" size="2"><%=Response.Write(Rs("Dept_Name")) %></font></td> <td width="11%" bgcolor="#FFFFFF" align="center"><font color="#08399C" size="2"><%=Response.Write(Rs("Dept_Coord")) %></font></td> <td width="26%" bgcolor="#FFFFFF" align="center"><font size="2" color="#08399C"><%=Response.Write(Rs("Dept_Desc")) %></font></td> </tr> <% rs.movenext %> <% Wend %></table></form><br><!--webbot bot="Include" U-Include="../../Menus/setup_bottom_menu_2.htm" TAG="BODY" --></body></html>

Link to comment
Share on other sites

I am brand new to scripting and this is my first page - I've been working on this for most of the evening and thought I'd ask for help.I get the following error message: ADODB.Recordset error '800a0e79' Operation is not allowed when the object is open. /Members/setup/add_department.asp, line 143Here is my HTML contents:<html><script language="VBscript"></script>  <head>      <title>Sign Up</title>  </head>  <!--#include file = "../../global.inc"-->  <body topmargin="0" leftmargin="0">      <table border="0" cellpadding="0" cellspacing="0" width="100%">        <tr>            <td id="headerBox"><!-- Header Graphics -->                  <!--webbot bot="Include" U-Include="../../Menus/MemberHeader.htm"-->              <a name="top"></a>              <table border="0" cellpadding="0" cellspacing="0" width="800">                  <tr>                    <td id="headerBox" width="799">                        <!-- Header Graphics -->                        <table border="0" cellpadding="0" cellspacing="0" width="760">                        </table>      <hr color="#000080">      <p><img border="0" src="../../images/newmem2.gif"><font face="Arial" size="2">Outreach 28 is designed on departments      completing events.  Once your departments are set-up you will complete the      event associated      with each department.  Then you will map on which day each event is to be      completed.  Listed at the bottom of the page are default departments and      default events you can edit or delete. </font></p>      </td>  </tr></table><table width="745"><form name="frm" method="post" action="">  <tr>    <td colSpan="6" width="1526">      <h3 align="center"><font color="#000080" face="Arial">Department      Information</font></h3>    </td>  </tr>  <tr>    <td width="4"><font face="Arial"> </font></td>    <td width="127" align="right"><font face="Arial" size="2">Department Name:</font></td>    <td width="220"><font face="Arial">    <input maxLength="50" name="Dept_Name" size="30"></font></td>    <td width="1"></td>    <td width="178" align="right"><font face="Arial" size="2">Department      Description:</font></td>    <td width="169"><font face="Arial">    <input maxLength="50" name="Dept_Desc" size="30"></font></td>  </tr>  <tr>    <td width="4"><font face="Arial"> </font></td>    <td width="127" align="right"><font face="Arial" size="2">Coordinator's  Name:</font></td>    <td width="220"><select name="Dept_Coord" size="1">    <%      Response.Buffer=True      select_sql2="SELECT Member_FName, Member_LName FROM Tbl_Member WHERE Church_ID = '"&session("Church_ID")&"'"            conn.open connect_string      Rs.open select_sql2, connect_string conn.Execute(select_sql2)%><option>Please select a member</option>    <% While Not rs.EOF %><option><%=Response.Write(Rs("Member_Fname") & " " & Rs("Member_LName")) %></option>      <% rs.movenext %>      <% Wend %><% conn.close %>      </select></td>    <td width="1"></td>    <td width="537" colspan="2"><font face="Arial" size="2" color="#008000"><a href="http://">Add      Events for this Department</a></font></td>  </tr>  <tr>    <td align="right" colSpan="6" width="1526">    <p align="center"> </td>  </tr>  <tr>    <td align="right" colSpan="6" width="1526">    <p align="left">      <input type="submit" name="btnSave" value="Save Department Information">      <input type="submit" name="btnBack" value="<< Back">      <input type="submit" name="btnNext" value="Next >>" onclick="NextClicked();" tabindex="12">      <input type="button" name="btnCancel" value="Cancel">            <%      Response.Buffer=True      select_sql="SELECT Dept_Name, Dept_Desc, Dept_Coord FROM Tbl_Dept WHERE Church_ID = '"&session("Church_ID")&"'"            conn.open connect_string      Rs.open select_sql, connect_string conn.Execute(select_sql) 'conn.close 'set conn=nothing %><% Dept_Name=Request.Form("Dept_Name")Dept_Desc=Request.Form("Dept_Desc")Dept_Coord=Request.Form("Dept_Coord")status=Request.Form("Status")submit_button=Request.Form("btnSave")next_button=Request.Form("btnNext")back_button=Request.Form("btnBack")dim insert_sqlinsert_sql="INSERT INTO tbl_Dept (Dept_Name, Dept_Desc, Dept_Coord, Church_ID) VALUES ('"&Dept_Name&"', '"&Dept_Desc&"', '"&Dept_Coord&"', '"&session("Church_ID")&"')"Response.write(submit_button)if submit_button = "Save Department Information" then conn.open connect_string Response.write(insert_sql) conn.Execute(insert_sql) 'conn.close set conn=nothing response.redirect("../setup/add_department.asp")         end ifif next_button = "Next >>" thenResponse.Redirect("../setup/newworker.asp")end ifif back_button = "<< Back" thenResponse.Redirect("../setup/newmember.asp")end if%><!----------- This page goes to newdirector next-------------- ------->      <!-- Include File = "../processfiles/printvariables.asp"-->      <!----------- END PAGE CONTENTS--------------------->      </td>  </tr></table><p><u><font face="Arial" color="#000080"><b>Current Departments</b></font></u></p><table border="0" width="95%">  <tr>    <td width="4%" bgcolor="#000080"> </td>    <td width="3%" bgcolor="#000080"> </td>    <td width="15%" bgcolor="#000080" align="center"><font color="#FFFFFF" face="Arial" size="1"><b>Department      Name</b></font></td>    <td width="11%" bgcolor="#000080" align="center"><font color="#FFFFFF" face="Arial" size="1"><b>Coordinator's      Name</b></font></td>    <td width="26%" bgcolor="#000080" align="center"><b>    <font face="Arial" size="1" color="#FFFFFF">Department Description</font></b></td>  </tr>    <% While Not rs.EOF %>  <tr>    <td width="4%" bgcolor="#FFFFFF"><font color="#008000" size="2">Edit</font></td>    <td width="3%" bgcolor="#FFFFFF"><font color="#008000" size="2">Delete</font></td>    <td width="15%" bgcolor="#FFFFFF" align="center"><font color="#08399C" size="2"><%=Response.Write(Rs("Dept_Name")) %></font></td>    <td width="11%" bgcolor="#FFFFFF" align="center"><font color="#08399C" size="2"><%=Response.Write(Rs("Dept_Coord")) %></font></td>    <td width="26%" bgcolor="#FFFFFF" align="center"><font size="2" color="#08399C"><%=Response.Write(Rs("Dept_Desc")) %></font></td>  </tr>      <% rs.movenext %>      <% Wend %></table></form><br><!--webbot bot="Include" U-Include="../../Menus/setup_bottom_menu_2.htm" TAG="BODY" --></body></html>

I am not sure but it can be becoz you have commented out the conn.close and conn = nothing. That error usually happens when the connection is open. It is better if you just post the code where the line says error, then it is easier to identify.
Link to comment
Share on other sites

sometimes this type of error occurs when databse u r referencing is opened exclusively..Check again may be this time it works.If not then give the code only for the line where the error occurs.Good Luck

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...