Results 1 to 2 of 2

Thread: SQL STORED PROCEDURES

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    UK
    Posts
    1

    Angry

    I am using the ADODB command object to run stored procedures in an SQL Database

    The procedure runs ok, i know this because i can see the data changing....However the command object is giving a null value for the return parameter...I need this parameter to pass into another stored procedure ....

    has anyone seen this problem before and if so did they find a fix?

    heres my statements.

    Set objcmd = New ADODB.Command
    Set objcmd.ActiveConnection = objconn

    'Insert parameters into the stored proceure
    objconn.CursorLocation = adUseClient

    objcmd.CommandText = "dbo.spa_PackingSlipCreate"
    objcmd.CommandType = adCmdStoredProc
    objcmd.Parameters.Append objcmd.CreateParameter("RC", adInteger, adParamReturnValue)
    objcmd.Parameters.Append objcmd.CreateParameter("OrderNo", adVarChar, adParamInput, 30, "000619-24052")
    objcmd.Parameters.Append objcmd.CreateParameter("PackSlipNo", adVarChar, adParamOutput, 30)
    objcmd.Execute

    'feedback
    MsgBox objcmd.Parameters.Item("RC")
    MsgBox objcmd.Parameters.Item("OrderNo")
    MsgBox objcmd.Parameters.Item("PackSlipNo")



    the output parameter is NULL all the time


    Please help

    Regards
    A frustrated programmer

  2. #2
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284
    Never tried doing it like that before but it looks to be ok.... what happens when you run the SP in the query analyser window?

Posting Permissions

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



Click Here to Expand Forum to Full Width