Urgent Help Please - 3704 Operation is not allowed when the object is closed


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Urgent Help Please - 3704 Operation is not allowed when the object is closed

  1. #1
    Paul Guest

    Urgent Help Please - 3704 Operation is not allowed when the object is closed


    Team,

    I have a weird problem. I'm working on an intranet web site ASP + Oracle
    database.
    I have to call a procedure named "REG_FIN" wich return 0 or many records.

    Once i call my procedure via my ASP code i got this error:
    "Error # 3704 Operation is not allowed when the object is closed"

    But if i create the same procedure with a different name like "REG_FIN1"
    and i change my call in asp code to: CmdFinADM.CommandText = "REG_FIN1" everything
    work good and i get my result.
    (Attention: "REG_FIN" and "REG_FIN1" both procedure must exists in the same
    location at the same time)

    - Note: I have created the same procedure "REG_FIN" in a seperate package,
    and my all my call works good via "ASP Code".


    Does anyone have a solution ??
    Thank you in advance
    Paul


    Here's my Code:
    -------------------------------------------------------------
    Dim RsFinADM
    Set RsFinADM = Server.CreateObject("ADODB.Recordset")

    Set CmdFinADM = Server.CreateObject("ADODB.Command")
    Set CmdFinADM.ActiveConnection = Application("objConnection")

    CmdFinADM.CommandText = "REG_FIN"
    CmdFinADM.CommandType = adCmdStoredProc
    CmdFinADM.Parameters.Append CmdFinADM.CreateParameter(, adVarChar, adParamInput,
    12, pCode)

    Set RsFinADM = CmdFinADM.Execute
    While not RsFinADM.eof

  2. #2
    Mark Guest

    Re: Urgent Help Please - 3704 Operation is not allowed when the object is closed


    Hi Paul

    You need to use SET NOCOUNT ON at the top of your stored procedure.

    For more info see this link http://www.biglist.com/lists/xsl-lis.../msg01272.html

    Cheers

    Mark

    "Paul" <paulnamroud@hotmail.com> wrote:
    >
    >Team,
    >
    >I have a weird problem. I'm working on an intranet web site ASP + Oracle
    >database.
    >I have to call a procedure named "REG_FIN" wich return 0 or many records.
    >
    >Once i call my procedure via my ASP code i got this error:
    >"Error # 3704 Operation is not allowed when the object is closed"
    >
    >But if i create the same procedure with a different name like "REG_FIN1"
    >and i change my call in asp code to: CmdFinADM.CommandText = "REG_FIN1"

    everything
    >work good and i get my result.
    >(Attention: "REG_FIN" and "REG_FIN1" both procedure must exists in the same
    >location at the same time)
    >
    >- Note: I have created the same procedure "REG_FIN" in a seperate package,
    >and my all my call works good via "ASP Code".
    >
    >
    >Does anyone have a solution ??
    >Thank you in advance
    >Paul
    >
    >
    >Here's my Code:
    >-------------------------------------------------------------
    >Dim RsFinADM
    >Set RsFinADM = Server.CreateObject("ADODB.Recordset")
    >
    >Set CmdFinADM = Server.CreateObject("ADODB.Command")
    >Set CmdFinADM.ActiveConnection = Application("objConnection")
    >
    >CmdFinADM.CommandText = "REG_FIN"
    >CmdFinADM.CommandType = adCmdStoredProc
    >CmdFinADM.Parameters.Append CmdFinADM.CreateParameter(, adVarChar, adParamInput,
    >12, pCode)
    >
    >Set RsFinADM = CmdFinADM.Execute
    >While not RsFinADM.eof



  3. #3
    graeme Guest

    Re: Urgent Help Please - 3704 Operation is not allowed when the object is closed


    Um, I always get this if a iuse temp tables in my stored proc, and forget
    to put SET NOCOUNT ON before inserting into the temp table.


    "Paul" <paulnamroud@hotmail.com> wrote:
    >
    >Team,
    >
    >I have a weird problem. I'm working on an intranet web site ASP + Oracle
    >database.
    >I have to call a procedure named "REG_FIN" wich return 0 or many records.
    >
    >Once i call my procedure via my ASP code i got this error:
    >"Error # 3704 Operation is not allowed when the object is closed"
    >
    >But if i create the same procedure with a different name like "REG_FIN1"
    >and i change my call in asp code to: CmdFinADM.CommandText = "REG_FIN1"

    everything
    >work good and i get my result.
    >(Attention: "REG_FIN" and "REG_FIN1" both procedure must exists in the same
    >location at the same time)
    >
    >- Note: I have created the same procedure "REG_FIN" in a seperate package,
    >and my all my call works good via "ASP Code".
    >
    >
    >Does anyone have a solution ??
    >Thank you in advance
    >Paul
    >
    >
    >Here's my Code:
    >-------------------------------------------------------------
    >Dim RsFinADM
    >Set RsFinADM = Server.CreateObject("ADODB.Recordset")
    >
    >Set CmdFinADM = Server.CreateObject("ADODB.Command")
    >Set CmdFinADM.ActiveConnection = Application("objConnection")
    >
    >CmdFinADM.CommandText = "REG_FIN"
    >CmdFinADM.CommandType = adCmdStoredProc
    >CmdFinADM.Parameters.Append CmdFinADM.CreateParameter(, adVarChar, adParamInput,
    >12, pCode)
    >
    >Set RsFinADM = CmdFinADM.Execute
    >While not RsFinADM.eof



  4. #4
    Join Date
    Mar 2008
    Posts
    1
    the SET NOCOUNT solution didn't work (have about 3 temp tables in the stored proc which are then dropped after the select)
    but changing the connectionstring from OLEDB to ODBC did the trick
    http://support.microsoft.com/default.aspx/kb/235340

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Welcome to DevX

    Thanks for posting a solution to what seems to be an long time outstanding question.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center