Computing.Net > Forums > Programming > Stored Procedure with update not wo

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Stored Procedure with update not wo

Reply to Message Icon

Name: tfs
Date: March 26, 2004 at 12:42:15 Pacific
OS: Win2K
CPU/Ram: 800mhz/512MB
Comment:

This is similar to another post that we figured out yesterday, where an update does not have a record set. In this case I have a stored procedure that does an update as well as passing back a value. I get the same error as update gives me if I try to test rs.EOF:

"Operation was not allowed when the object was closed"

The stored procedure:
*******************************************
CREATE PROCEDURE getLastBook
as
declare @book char(5)

select @book=max(book_key) from booking

update booking set status = 150 where book_key = "70005"

select @book
*****************************************

If I don't have the update statement in the SP, then it works fine. As a matter of fact, the SP works and does the update, but there is apparently no RS to access and there should be as @book is being passed back (and it is there if I don't have the update).

The ASP code is:
*******************************************
HTML>
<HEAD>
<TITLE>ABC Corporation</TITLE>
</HEAD>
<BODY>

<H2>ABC Corporation Employee Telephone Extensions</H2>

<%
Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout=60
connectionToDatabase.Open "Provider=sqloledb;data source=steg;" & _
"initial catalog=travdata;" & _
"user id=sa;password="

Set recordCollection =connectionToDatabase.Execute("exec getLastBook")

if not recordCollection.eof then
respond.write(recordCollection(0))
end if

connectionToDatabase.Close
Set connectionToDatabase=Nothing

%>

</BODY>
</HTML>
********************************************

I get the error on the "recordCollection.eof" line.

What is the problem here?

Thanks,
Tom



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


BAT File to Access Outloo... C++ make file containing



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Stored Procedure with update not wo

Stored Procedure not working if OLE www.computing.net/answers/programming/stored-procedure-not-working-if-ole/10101.html

Store Procedure in Sql ..? www.computing.net/answers/programming/store-procedure-in-sql-/9409.html

Oracle Stored procedures www.computing.net/answers/programming/oracle-stored-procedures/4879.html