Can't display data returned by a stored proced

Results 1 to 2 of 2

Thread: Can't display data returned by a stored proced

  1. #1
    Charlie Pyne Guest

    Default Can't display data returned by a stored proced

    Hi. <BR><BR>I&#039m having a problem with a stored procedure that creates a record and then returns the order number of the record that it created.<BR><BR>Heres the section of the page I&#039m trying to get working...<BR><BR>&#060;!--#include virtual="/code_reuse/connection.asp"--&#062;<BR>&#060;!--#include virtual="/IISHELP/ado/"--&#062;<BR>&#060;%<BR>DIM new_jwo_sql<BR>DIM new_jwo_rs<BR>new_jwo_sql = "EXEC spcreate_jwo &#039" & session.contents("employee_id") & "&#039, &#039" & session.contents("institution") & "&#039"<BR><BR>set new_jwo_rs = Server.CreateObject("ADODB.Recordset")<BR>new_jwo_ new_jwo_sql, dev_conn, adopenstatic<BR><BR>response.write new_jwo_rs("jack_wo_id")<BR><BR>%&#062;<BR><BR><BR >I know the sql is good. I did response.write new_jwo_sql and pasted it into query analizer with no problems.<BR><BR>When I run this page I get...<BR><BR>ADODB.Fields error &#039 800a0cc1&#039 <BR><BR>ADO could not find the object in the collection corresponding to the name or ordinal reference requested by the application. <BR><BR>/create_new_JWO.asp, line 19 <BR><BR><BR>I get no errors, (just a blank screen), if I comment out the last response.write line.<BR><BR>HELP!!!!!!<BR><BR><BR><BR>(here&#039s the sp if it helps)....<BR><BR><BR>CREATE PROCEDURE spcreate_JWO(@author VARCHAR(10), @institution VARCHAR(3))<BR>AS<BR><BR>BEGIN<BR>-- Declare local variables<BR>DECLARE @new_jwo INT --Variable to hold new JWO ID<BR><BR><BR>-- Create a blank DWO<BR><BR>INSERT INTO jack_work_order(jack_date, jack_wo_written_by, jack_institution, jack_status)<BR>SELECT getdate() AS jack_date, @author as jack_wo_written_by, @institution AS jack_institution, &#039 3&#039 AS jack_status <BR><BR><BR><BR>-- Get new DWO number<BR>SELECT MAX(j.jack_wo_id) AS jack_wo_id<BR>FROM jack_work_order AS j <BR>WHERE j.jack_wo_written_by = @author<BR><BR><BR>END<BR><BR>GO

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default You think it could be your connection obj???

    is dev_conn being created. I dont thik you have an valid connection object on that page<BR><BR>response.write dev_conn.state<BR><BR>what does it give 0 or a 1 ??

Posting Permissions

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