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 -
Dim IsRate Dim cmd
-
Dim rs
-
-
Set cmd = createobject("ADODB.Command")
-
Set rs = createobject("ADODB.RecordSet")
-
with cmd
-
.ActiveConnection=gObjConnect
-
.CommandType=adCmdStoredProc
-
.CommandText="RateList_test"
-
.Parameters.Append .CreateParameter("@ZipFrom",adVarChar, adParamInput,6,mZipFr)
-
.Parameters.Append .CreateParameter("@ZipTo", adVarChar, adParamInput,6,mZipTo)
-
-
'........
-
-
.Parameters.Append .CreateParameter("@RateUsed", adInteger, adParamOutput,,0)
-
Set rs = cmd.Execute
-
IsRate = cmd.Parameters("@RateUsed")
-
response.Write rs.Status
-
end with
-
set cmd = nothing
-
-
Dim sqlCar, RScar, SFlag
-
SweeneyFlag = 0
-
if not rs.eof then '-->Fails here
-
-
4 1754
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.
Anyone have a clue where I could be going wrong?
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: - query = "RateList_test " & firstInput & ", " & secondInput & ", " & nthInput
-
'response.write query 'for troubleshooting only
-
-
Set rs = gObjConnect.Execute(query) 'execute sql call
-
'or this last line could be
-
'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
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
Sign in to post your reply or Sign up for a free account.
Similar topics |
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');"
|
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")
|
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 =...
|
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:...
|
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
| |
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:
|
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...
|
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")
|
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...
|
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"
|
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,...
| |
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...
|
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,...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |