SP OUTPUT VALUE PROBLEM

  • Thread starter Jeffrey K. Ericson
  • Start date
S

Savas Ates

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
 
R

Rick Sawtell

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
 
S

Savas Ates

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" <[email protected]>, haber
iletisinde þunlarý
yazdý:[email protected]...
 
D

Daniel Crichton

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.
Set rs = cmd.Execute

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

Dan
 
S

Savas Ates

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
 
W

William \(Bill\) Vaughn

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.
__________________________________
 
D

Daniel Crichton

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top