Operation is not allowed when the object is closed.

Discussion in 'ASP General' started by Guest, Dec 20, 2004.

  1. Guest

    Guest Guest

    So, I am getting this really annoying error.. the SQL Statement executes
    perfectly in Query Analyzer.. all I am doing is basically duplicating a row
    (insert into select from) from one table back into itself. This is so that
    people can duplicate a report definition and then edit.. Basically i store
    the XMLDATA property of the OWC in a SQL table and have a couple of pages
    for finding report defs.. not too complex..

    Error Type:
    ADODB.Recordset (0x800A0E78)
    Operation is not allowed when the object is closed.
    /epo2/page7_5.asp, line 85

    This code is cut and paste from dreamweaver; i sure as heck couldn't get the
    command working.. but I'm not going to make major changes to any of this.. I
    just need to know why it isn't working.


    And I'm doing this via SQL authentication.. I am going to protect against
    SQL injections once i troubleshoot this problem (I removed most of that
    stuff to troubleshoot)

    <!--#include file="TOP.asp" -->
    <%
    Dim rstDuplicate__OLDDEFID
    rstDuplicate__OLDDEFID = "1"
    If (request("DEFID") <> "") Then
    rstDuplicate__OLDDEFID = request("DEFID")
    End If
    %>
    <%
    Dim rstDuplicate__ENTEREDBY
    rstDuplicate__ENTEREDBY = "AARKEM"
    If (session("ALIAS") <> "") Then
    rstDuplicate__ENTEREDBY = session("ALIAS")
    End If
    %>
    <%
    Dim rstDuplicate
    Dim rstDuplicate_numRows

    Set rstDuplicate = Server.CreateObject("ADODB.Recordset")
    rstDuplicate.ActiveConnection = MM_SQLMAIN_STRING
    rstDuplicate.Source = "EXEC SPDUPLICATERPTDEF " &
    cstr(rstDuplicate__OLDDEFID) & ", '" & rstDuplicate__ENTEREDBY & "'"
    rstDuplicate.CursorType = 0
    rstDuplicate.CursorLocation = 2
    rstDuplicate.LockType = 1
    rstDuplicate.Open()
    Guest, Dec 20, 2004
    #1
    1. Advertising

  2. Do you have SET NOCOUNT ON in your SP?

    http://www.aspfaq.com/show.asp?id=2307
    http://www.aspfaq.com/show.asp?id=2275

    Ray at work


    <> wrote in message
    news:...
    > So, I am getting this really annoying error.. the SQL Statement executes
    > perfectly in Query Analyzer.. all I am doing is basically duplicating a

    row
    > (insert into select from) from one table back into itself. This is so

    that
    > people can duplicate a report definition and then edit.. Basically i store
    > the XMLDATA property of the OWC in a SQL table and have a couple of pages
    > for finding report defs.. not too complex..
    >
    > rstDuplicate.Source = "EXEC SPDUPLICATERPTDEF " &
    Ray Costanzo [MVP], Dec 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    2,101
    Kevin Spencer
    Aug 10, 2005
  2. Matthew Louden
    Replies:
    6
    Views:
    238
    Ken Schaefer
    Sep 28, 2003
  3. cliverama
    Replies:
    1
    Views:
    125
    Aaron Bertrand [MVP]
    Nov 5, 2003
  4. TC
    Replies:
    1
    Views:
    133
    madhouse
    Jan 12, 2005
  5. Arpan
    Replies:
    2
    Views:
    110
    Arpan
    Sep 5, 2005
Loading...

Share This Page