473,378 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Operation is not allowed when the object is closed

rrocket
116 100+
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.Recordset 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 1745
rrocket
116 100+
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 100+
Anyone have a clue where I could be going wrong?
Aug 27 '08 #3
jhardman
3,406 Expert 2GB
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 Expert 2GB
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
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...
1
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...
17
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...
1
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...
2
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 ...
1
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...
8
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: ========================================================...
1
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...
5
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...
1
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.