If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
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, 11: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, 00: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 00: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

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