473,790 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Operation is not allowed when the object is closed

rrocket
116 New Member
I am trying send information to the DB and the SP will return a recordset. The problem is that I keep getting this error (ADODB.Recordse t error '800a0e78' Operation is not allowed when the object is closed). I saw a bunch of posts using queries, but none using SPs and cannot resolve the issue.

Here is a sample of the code... If more is needed let me know
Expand|Select|Wrap|Line Numbers
  1. Dim IsRate    Dim cmd
  2.     Dim rs
  3.  
  4.     Set cmd = createobject("ADODB.Command")
  5.     Set rs = createobject("ADODB.RecordSet")
  6.     with cmd
  7.         .ActiveConnection=gObjConnect
  8.         .CommandType=adCmdStoredProc
  9.         .CommandText="RateList_test"
  10.         .Parameters.Append .CreateParameter("@ZipFrom",adVarChar, adParamInput,6,mZipFr)
  11.         .Parameters.Append .CreateParameter("@ZipTo", adVarChar, adParamInput,6,mZipTo)
  12.  
  13. '........
  14.  
  15. .Parameters.Append .CreateParameter("@RateUsed", adInteger, adParamOutput,,0)
  16.         Set rs = cmd.Execute
  17.         IsRate = cmd.Parameters("@RateUsed")
  18.         response.Write rs.Status
  19.         end with
  20.         set cmd = nothing
  21.  
  22.     Dim sqlCar, RScar, SFlag    
  23.     SweeneyFlag = 0
  24.     if not rs.eof then '-->Fails here
  25.  
  26.  
Aug 26 '08 #1
4 1754
rrocket
116 New Member
If this does not make sense or more info is needed, please let me know.

I guess what I am ultimately asking is how to open the rs connection when the command object is used.
Aug 27 '08 #2
rrocket
116 New Member
Anyone have a clue where I could be going wrong?
Aug 27 '08 #3
jhardman
3,406 Recognized Expert Specialist
I don't use sp's as often as I should, but this is the most obvious (and easiest to troubleshoot) way to call it from asp:
Expand|Select|Wrap|Line Numbers
  1. query = "RateList_test " & firstInput & ", " & secondInput & ", " & nthInput
  2. 'response.write query 'for troubleshooting only
  3.  
  4. Set rs = gObjConnect.Execute(query) 'execute sql call
  5. 'or this last line could be
  6. 'rs.open query, gObjConnect 
The big advantage this has is you can print out the query, drop it into your query analyzer and see if it returns anything. When you use an ADODB.command I don't know of any way to print out or analyze the command it sends to the db. Anyway, let me know if this helps.

Jared
Aug 28 '08 #4
jhardman
3,406 Recognized Expert Specialist
btw, many of our experts search for unanswered posts, so replying to your own thread probably hurt your chance of getting an answer. Sending a polite PM to one of the forum experts asking them to look into your thread (which you did) is just fine.

Jared, moderator
Aug 28 '08 #5

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

Similar topics

6
46912
by: Matthew Louden | last post by:
The following ASP code yields the following error, but actually the new record is stored in database. The same error happens when the application deletes a record, such as sqlStmt ="delete from test where username='2323'" Any ideas? Thanks! <% Dim objRS, sqlStmt Set objRS = Server.CreateObject ("ADODB.Recordset") sqlStmt = "insert into test VALUES ('2341', '2341');"
1
4865
by: cliverama | last post by:
help! fried brains.... asp calling a sqlserver7 stored proc which dynamically builds a sqlstatement & passes it to sp_executesql asp page gives the operation not allowed when object is closed error this is the asp code: Set connInc= server.CreateObject("ADODB.Connection") connInc.Open "DSN=db_database;User ID=userid;Password=xxxxxx" Set rsInc= server.CreateObject("ADODB.Recordset")
17
2729
by: James Baker | last post by:
I'm getting an error: "Operation is not allowed when the object is closed." on the lines of code below. I can't imagine why the object would be closed where it says it will be, I've just opened it on the line before. This is all within a larger loop, but the loop seems to be working fine and other insert statements within it seem ok. Any suggestions? Dim cmsRS, cmsSQL Dim insRS, insSQL Set cmsRS =...
1
655
by: | last post by:
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:...
2
5065
by: Arpan | last post by:
An ASP application updates a SQL Server database table after a Form is submitted after which the user is directed to another page that should display the updated records. If the code is ---------------------------------------- 'records get updated here Response.Redirect("Records.asp") objRS.Close Set objRS=Nothing
1
2695
by: amitbadgi | last post by:
Hello guys I am getting this error while converting an asp applicayion to asp.net Exception Details: System.Runtime.InteropServices.COMException: Operation is not allowed when the object is closed. Source Error: Line 168: rs = Server.CreateObject("ADODB.recordset")Line 169:
8
3007
by: Jim in Arizona | last post by:
I've been using an example out of a book to be able to edit the rows in a database. I am getting the following error: ======================================================== ======================================================== Server Error in '/' Application. -------------------------------------------------------------------------------- Operation must use an updateable query. Description: An unhandled exception occurred during...
1
4024
by: Matt | last post by:
Got this problem that killing me...what am i doing wrong with this old dll. When i call the function from asp i get "Operation is not allowed when object is closed" any clue will be appriciated.... test .asp <% dim oObj dim a set oObj= server.CreateObject("MyDll.MyClass")
5
2185
by: Sonasang | last post by:
Hi , I am creating a web page with ASP and Javascript.We have shared the foldres containg the code and all our team members are accessing the code. There is no problem for me when i run the code and working properly. But when some of my team members when they run the web page they are getting the ERROR in function() Operation is not allowed when the object is closed. In the login page there in no problem, After we login in the page...
1
20647
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but I don't see the error): "System.IO.IOException: Unable to read data from the transport connection:A blocking operation was interrupted by a call to WSACancelBlockingCall"
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.