Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2001
    Location
    Southend-on-Sea/England
    Posts
    8

    Unanswered: 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.

  2. #2
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •