ADO Parameters error

From: Patrick Russell (prussel_at_cfl.rr.com)
Date: 12/18/04

  • Next message: pmud: "Connecting an Existing application to SQL database"
    Date: Sat, 18 Dec 2004 16:08:04 GMT
    
    

    Can anyone please explain why this would give me the following error?

    ADODB.Parameters (0x800A0E7C)
    Parameter object is improperly defined. Inconsistent or incomplete
    information was provided.

    The error occurs when I Append the new parameter object to the parameters
    collection.

    ----------------------------------------------------------------------------
    -------
    --ASP Code
    set oConn = Server.CreateObject("ADODB.Connection")
    set cmdRtn = Server.CreateObject("ADODB.Command")
    oConn.Open strConnect
    with cmdRtn
         cmdRtn.ActiveConnection = oConn
         cmdRtn.CommandText = "sp_zz_test"
         cmdRtn.CommandType = adCmdStoredProc

         SET RTNVAL =
    cmdRtn.CreateParameter("RETURN_VALUE",adVarChar,adParamReturnValue)
         cmdRtn.Parameters.Append RTNVAL
         cmdRtn.Execute ,,adExecuteNoRecords
         rtnVal = .Parameters("RETURN_VALUE")
         Response.Write rtnVal
    end with
    ----------------------------------------------------------------------------
    ----------------------
    --sProc Code
    CREATE PROCEDURE sp_zz_test

    AS

    DECLARE @Rtn varchar(10)

    SET @Rtn = 'All Done'
    RETURN @Rtn
    GO

    -ENUM Values
    Const adCmdStoredProc = &H0004
    Const adVarChar = 200
    Const adParamReturnValue = &H0004
    Const adExecuteNoRecords = &H00000080

    Thanks
    Patrick


  • Next message: pmud: "Connecting an Existing application to SQL database"