Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Table data type and ASP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-28-03, 12:26
TimK TimK is offline
Registered User
 
Join Date: Jul 2001
Location: Southend-on-Sea/England
Posts: 8
Table data type and ASP

Hi,

I have a problem returning data from a stored procedure on an ASP page using a table data type as follows.

---- the proc -----
alter PROC usp_timtest3
as
declare @faults table (faultid int, faultdesc varchar(200),fault_children varchar(4000),numcalls int,numjobs int)

INSERT INTO @faults (faultid,faultdesc,numcalls,numjobs) values(1,'111',0,0)

select * from @faults

---- the asp ------
set rs = server.CreateObject("ADODB.Recordset")
set cmd = server.CreateObject("ADODB.Command")
with cmd
.ActiveConnection = Application("ConnectionString")
.CommandText = "usp_timtest3"
.CommandType = adCmdStoredProc
end with
set rs = cmd.Execute
if not rs.EOF then
Response.Write "OK"
else
Response.Write "Not OK"
end if

---- the error message ----
ADODB.Recordset error '800a0e78'

Operation is not allowed when the object is closed.

/echsol/_Reports/hd/test.asp, line 14


Has any body got any ideas as it's driving me nuts.
Reply With Quote
  #2 (permalink)  
Old 04-30-03, 01:33
Memnoch1207 Memnoch1207 is offline
Registered User
 
Join Date: Jan 2003
Location: Midwest
Posts: 138
that error means you are trying to run information against a database, but the connection to the db is closed...do a response.write(conn.state) to verify that it is 0 (closed) or (1) open.

If it is closed then open it.
Code:
if(cmd.state = 0) then cmd.open(Application("ConnectionString")) end if

Last edited by Memnoch1207 : 04-30-03 at 01:35.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On