SP OUTPUT VALUE PROBLEM

Discussion in 'ASP General' started by Jeffrey K. Ericson, Jun 6, 2005.

  1. Shouldn't one of the parameters in the ASP code by output?

    "Savas Ates" wrote:

    > ERROR
    > Error Type: ADODB.Command
    > (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range,
    > or are
    >
    > line : .Parameters.Append .CreateParameter("@inparm", adInteger,
    > adParamInput)
    >
    >
    > MYPROC IS
    >
    > CREATE PROCEDURE st_myProc
    >
    > @inparm INT , @outparm INT OUTPUT
    > AS
    > SET @outparm=10
    > GO
    >
    > ASP CODE WITH ADO
    >
    >
    > set cmd=server.CreateObject ("ADODB.Command")
    > Set cmd.ActiveConnection = baglantim
    > cmd.CommandText = "st_myProc"
    > cmd.CommandType = 4
    > with cmd
    > .Parameters.Append .CreateParameter("@inparm", adInteger, adParamInput)
    > .Parameters.Append .CreateParameter("@inparm", adInteger, adParamInput)
    > end with
    >
    > Set rs = cmd.Execute
    > Dim i
    > While Not rs.EOF
    > Response.Write rs.Fields(i)&" "
    > i = i + 1
    >
    > rs.MoveNext
    >
    > Wend
    >
    >
    >
     
    Jeffrey K. Ericson, Jun 6, 2005
    #1
    1. Advertising

  2. Jeffrey K. Ericson

    Savas Ates Guest

    ERROR
    Error Type: ADODB.Command
    (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range,
    or are

    line : .Parameters.Append .CreateParameter("@inparm", adInteger,
    adParamInput)


    MYPROC IS

    CREATE PROCEDURE st_myProc

    @inparm INT , @outparm INT OUTPUT
    AS
    SET @outparm=10
    GO

    ASP CODE WITH ADO


    set cmd=server.CreateObject ("ADODB.Command")
    Set cmd.ActiveConnection = baglantim
    cmd.CommandText = "st_myProc"
    cmd.CommandType = 4
    with cmd
    .Parameters.Append .CreateParameter("@inparm", adInteger, adParamInput)
    .Parameters.Append .CreateParameter("@inparm", adInteger, adParamInput)
    end with

    Set rs = cmd.Execute
    Dim i
    While Not rs.EOF
    Response.Write rs.Fields(i)&" "
    i = i + 1

    rs.MoveNext

    Wend
     
    Savas Ates, Jun 6, 2005
    #2
    1. Advertising

  3. Jeffrey K. Ericson

    Rick Sawtell Guest

    > with cmd
    > .Parameters.Append .CreateParameter("@inparm", adInteger,

    adParamInput)
    > .Parameters.Append .CreateParameter("@inparm", adInteger,

    adParamInput)
    > end with



    You have two issues. The first is that you are trying to create the same
    parameter twice. The second is that the second parameter needs to be
    spec'ced as either an InputOutput or just an Output parm.


    You need to change your second line here to something like:

    .Parameters.Append.CreateParamenter("@outparm", adInteger,
    adParamOutput)



    Rick Sawtell
     
    Rick Sawtell, Jun 6, 2005
    #3
  4. Jeffrey K. Ericson

    Savas Ates Guest

    actual with statement... what u mean?

    Shouldn't one of the parameters in the ASP code by output? what is your
    verb here ? how can i solve this promlem ?
    with cmd
    .Parameters.Append .CreateParameter ("@inparm", adInteger, adParamInput
    , ,10)
    .Parameters.Append .CreateParameter ("@outparm", adInteger,
    adParamOutput)
    end with



    "Jeffrey K. Ericson" <>, haber
    iletisinde þunlarý
    yazdý:...
    > Shouldn't one of the parameters in the ASP code by output?
    >
    > "Savas Ates" wrote:
    >
    >> ERROR
    >> Error Type: ADODB.Command
    >> (0x800A0BB9) Arguments are of the wrong type, are out of acceptable
    >> range,
    >> or are
    >>
    >> line : .Parameters.Append .CreateParameter("@inparm", adInteger,
    >> adParamInput)
    >>
    >>
    >> MYPROC IS
    >>
    >> CREATE PROCEDURE st_myProc
    >>
    >> @inparm INT , @outparm INT OUTPUT
    >> AS
    >> SET @outparm=10
    >> GO
    >>
    >> ASP CODE WITH ADO
    >>
    >>
    >> set cmd=server.CreateObject ("ADODB.Command")
    >> Set cmd.ActiveConnection = baglantim
    >> cmd.CommandText = "st_myProc"
    >> cmd.CommandType = 4
    >> with cmd
    >> .Parameters.Append .CreateParameter("@inparm", adInteger,
    >> adParamInput)
    >> .Parameters.Append .CreateParameter("@inparm", adInteger,
    >> adParamInput)
    >> end with
    >>
    >> Set rs = cmd.Execute
    >> Dim i
    >> While Not rs.EOF
    >> Response.Write rs.Fields(i)&" "
    >> i = i + 1
    >>
    >> rs.MoveNext
    >>
    >> Wend
    >>
    >>
    >>
     
    Savas Ates, Jun 6, 2005
    #4
  5. Savas wrote on Mon, 6 Jun 2005 18:24:53 +0300:

    > ERROR
    > Error Type: ADODB.Command
    > (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range,
    > or are
    >
    > line : .Parameters.Append .CreateParameter("@inparm", adInteger,
    > adParamInput)
    >
    > MYPROC IS
    >
    > CREATE PROCEDURE st_myProc
    >
    > @inparm INT , @outparm INT OUTPUT
    > AS
    > SET @outparm=10
    > GO
    >
    > ASP CODE WITH ADO
    >
    > set cmd=server.CreateObject ("ADODB.Command")
    > Set cmd.ActiveConnection = baglantim
    > cmd.CommandText = "st_myProc"
    > cmd.CommandType = 4
    > with cmd
    > .Parameters.Append .CreateParameter("@inparm", adInteger,
    > adParamInput)
    > .Parameters.Append .CreateParameter("@inparm", adInteger,
    > adParamInput)


    How about changing that 2nd one to

    .Parameters.Append .CreateParameter("@outparm", adInteger,
    adParamOutput)


    Also, are you sure the adInteger, adParamInput, and adParamOutput constants
    are defined in your ASP? If you're on IIS5 or higher I think they're
    automatically included, but on IIS3 and IIS4 you need to include the
    adovbs.inc that contains them.

    > end with


    > Set rs = cmd.Execute


    You haven't set the value of the input parameter yet, why are you executing
    the command object?

    Dan
     
    Daniel Crichton, Jun 6, 2005
    #5
  6. Jeffrey K. Ericson

    Savas Ates Guest

    my iis wersion windows xp's 5.0 or greater .. How can i solve it .. still it
    doesnt work...

    with cmd
    ..Parameters.Append .CreateParameter ("@inparm" , adInteger, adParamInput, ,
    10)
    .Parameters.Append .CreateParamenter ("@outparm", adInteger,adParamOutput)
    end with







    "Savas Ates" <>, haber iletisinde þunlarý
    yazdý:...
    > ERROR
    > Error Type: ADODB.Command
    > (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range,
    > or are
    >
    > line : .Parameters.Append .CreateParameter("@inparm", adInteger,
    > adParamInput)
    >
    >
    > MYPROC IS
    >
    > CREATE PROCEDURE st_myProc
    >
    > @inparm INT , @outparm INT OUTPUT
    > AS
    > SET @outparm=10
    > GO
    >
    > ASP CODE WITH ADO
    >
    >
    > set cmd=server.CreateObject ("ADODB.Command")
    > Set cmd.ActiveConnection = baglantim
    > cmd.CommandText = "st_myProc"
    > cmd.CommandType = 4
    > with cmd
    > .Parameters.Append .CreateParameter("@inparm", adInteger, adParamInput)
    > .Parameters.Append .CreateParameter("@inparm", adInteger, adParamInput)
    > end with
    >
    > Set rs = cmd.Execute
    > Dim i
    > While Not rs.EOF
    > Response.Write rs.Fields(i)&" "
    > i = i + 1
    >
    > rs.MoveNext
    >
    > Wend
    >
    >
     
    Savas Ates, Jun 6, 2005
    #6
  7. http://www.aspfaq.com/show.asp?id=2112

    Savas Ates wrote:
    > my iis wersion windows xp's 5.0 or greater .. How can i solve it ..
    > still it doesnt work...
    >
    > with cmd
    > .Parameters.Append .CreateParameter ("@inparm" , adInteger,
    > adParamInput, , 10)
    > .Parameters.Append .CreateParamenter ("@outparm",
    > adInteger,adParamOutput) end with
    >
    >
    >


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jun 6, 2005
    #7
  8. Ok, what's "not working"? Does the code fail to compile, run, return the
    OUTPUT parameter, return the same exception?

    --
    ____________________________________
    William (Bill) Vaughn
    Author, Mentor, Consultant
    Microsoft MVP
    www.betav.com/blog/billva
    www.betav.com
    www.sqlreportingservices.net
    Please reply only to the newsgroup so that others can benefit.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    __________________________________


    "Savas Ates" <> wrote in message
    news:...
    > my iis wersion windows xp's 5.0 or greater .. How can i solve it .. still
    > it doesnt work...
    >
    > with cmd
    > .Parameters.Append .CreateParameter ("@inparm" , adInteger, adParamInput,
    > , 10)
    > .Parameters.Append .CreateParamenter ("@outparm", adInteger,adParamOutput)
    > end with
    >
    >
    >
    >
    >
    >
    >
    > "Savas Ates" <>, haber iletisinde þunlarý
    > yazdý:...
    >> ERROR
    >> Error Type: ADODB.Command
    >> (0x800A0BB9) Arguments are of the wrong type, are out of acceptable
    >> range, or are
    >>
    >> line : .Parameters.Append .CreateParameter("@inparm", adInteger,
    >> adParamInput)
    >>
    >>
    >> MYPROC IS
    >>
    >> CREATE PROCEDURE st_myProc
    >>
    >> @inparm INT , @outparm INT OUTPUT
    >> AS
    >> SET @outparm=10
    >> GO
    >>
    >> ASP CODE WITH ADO
    >>
    >>
    >> set cmd=server.CreateObject ("ADODB.Command")
    >> Set cmd.ActiveConnection = baglantim
    >> cmd.CommandText = "st_myProc"
    >> cmd.CommandType = 4
    >> with cmd
    >> .Parameters.Append .CreateParameter("@inparm", adInteger,
    >> adParamInput)
    >> .Parameters.Append .CreateParameter("@inparm", adInteger,
    >> adParamInput)
    >> end with
    >>
    >> Set rs = cmd.Execute
    >> Dim i
    >> While Not rs.EOF
    >> Response.Write rs.Fields(i)&" "
    >> i = i + 1
    >>
    >> rs.MoveNext
    >>
    >> Wend
    >>
    >>

    >
    >
     
    William \(Bill\) Vaughn, Jun 6, 2005
    #8
  9. Savas wrote on Mon, 6 Jun 2005 19:24:24 +0300:

    > my iis wersion windows xp's 5.0 or greater .. How can i solve it .. still
    > it doesnt work...
    >
    > with cmd
    > .Parameters.Append .CreateParameter ("@inparm" , adInteger, adParamInput,
    > , 10)
    > .Parameters.Append .CreateParamenter ("@outparm",
    > adInteger,adParamOutput) end with


    Try

    ..Parameters.Append .CreateParameter ("@inparm" , 3, &H0001, , 10)

    ..Parameters.Append .CreateParameter ("@outparm", 3, &H0002)


    as it appears that the constants adInteger, adParamInput, and adParamOutput
    are not defined in your IIS installation. Follow the link given by Bob
    Barrows for more info on how to add them if you rather constant names for
    easier reading.

    Dan
     
    Daniel Crichton, Jun 7, 2005
    #9
  10. Let this SQL Server ADO.NET code generator write the code for you

    http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp

    --
    2004 and 2005 Microsoft MVP C#
    Robbe Morris
    http://www.masterado.net

    Earn $$$ money answering .NET Framework
    messageboard posts at EggHeadCafe.com.
    http://www.eggheadcafe.com/forums/merit.asp



    "Savas Ates" <> wrote in message
    news:...
    > ERROR
    > Error Type: ADODB.Command
    > (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range,
    > or are
    >
    > line : .Parameters.Append .CreateParameter("@inparm", adInteger,
    > adParamInput)
    >
    >
    > MYPROC IS
    >
    > CREATE PROCEDURE st_myProc
    >
    > @inparm INT , @outparm INT OUTPUT
    > AS
    > SET @outparm=10
    > GO
    >
    > ASP CODE WITH ADO
    >
    >
    > set cmd=server.CreateObject ("ADODB.Command")
    > Set cmd.ActiveConnection = baglantim
    > cmd.CommandText = "st_myProc"
    > cmd.CommandType = 4
    > with cmd
    > .Parameters.Append .CreateParameter("@inparm", adInteger, adParamInput)
    > .Parameters.Append .CreateParameter("@inparm", adInteger, adParamInput)
    > end with
    >
    > Set rs = cmd.Execute
    > Dim i
    > While Not rs.EOF
    > Response.Write rs.Fields(i)&" "
    > i = i + 1
    >
    > rs.MoveNext
    >
    > Wend
    >
    >
     
    Robbe Morris [C# MVP], Jun 10, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Bentley

    Output / Debug window output bug?

    John Bentley, Sep 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    595
    John Bentley
    Sep 10, 2003
  2. Michael Ahlers
    Replies:
    1
    Views:
    5,665
    Martin Honnen
    Jul 12, 2004
  3. =?UTF-8?b?5byg6Z+h5q2m?=
    Replies:
    3
    Views:
    709
    DeepthiShri
    Oct 23, 2006
  4. Michel Rouzic

    weird function output value problem

    Michel Rouzic, Jun 17, 2005, in forum: C Programming
    Replies:
    8
    Views:
    275
    Lawrence Kirby
    Jun 17, 2005
  5. Paul
    Replies:
    1
    Views:
    430
Loading...

Share This Page