Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 ifconnectionToDatabase.Close
Set connectionToDatabase=Nothing%>
</BODY>
</HTML>
********************************************I get the error on the "recordCollection.eof" line.
What is the problem here?
Thanks,
Tom

![]() |
BAT File to Access Outloo...
|
C++ make file containing
|

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