Hello All,
Hoping for a little help.
I'm using a parametered sql stored proc to accept and return variables to my
asp page. The SP works fine as I've tested it separately.

The error and code is below.
Fairly new to asp, all comments are appreciated.
Thanks in advance, R


Here is the error:
ADODB.Command error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/gplogout.asp, line 83


Here is my asp:

<%
Dim objConn
Dim objCmd
Dim txtUser
Dim txtPswd
dim txtloggedout

'Form Values
txtUser = request.form("txtUserName")
txtPswd = request.form("txtPassword")

<!--include file=adovbs.inc"-->

Set objConn = Server.CreateObject("ADODB.Connection")

objConn.open "Provider=SQLOLEDB;Data Source=SQLServer;Initial
Catalog=MYDB;User ID=UserName;Password=1234"


set objCmd = Server.CreateObject("ADODB.Command")
With objCmd
.ActiveConnection = objConn
.CommandText = "X_storedproc_test"
.CommandType = 4 'adcmdstoredproc 'Requires the adovbs.inc file or
typelib meta tag

'Add Input Parameters
.Parameters.Append .CreateParameter("@UName", adVarChar, adParamInput,
30, txtUser)
.Parameters.Append .CreateParameter("@Pswrd", adVarChar, adParamInput,
30, txtPswd)

'Add Output Parameters
.Parameters.Append .CreateParameter("@loggedout", adInteger, adParamOutput)

'Execute the function
.Execute, , adExecuteNoRecords

'Extract the output parameter which the SP has supplied from the parameter
collection'
txtloggedout = .parameters("@loggedout")

End With

'Update the user

Re: ADODB.Command error '800a0bb9' by Bob

Bob
Mon Aug 16 08:46:49 CDT 2004

R wrote:
> Hello All,
> Hoping for a little help.
> I'm using a parametered sql stored proc to accept and return
> variables to my asp page. The SP works fine as I've tested it
> separately.
>
> The error and code is below.
> Fairly new to asp, all comments are appreciated.
> Thanks in advance, R
>
>
> Here is the error:
> ADODB.Command error '800a0bb9'
> Arguments are of the wrong type, are out of acceptable range, or are
> in conflict with one another.
> /gplogout.asp, line 83
>
>
At least one of the ADO constants (adParamOutput, adExecuteNoRecords, etc.)
you are using is not in the adovbs.inc file you included. I have run into
this before with adExecuteNoRecords, whose value should be 128.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Re: ADODB.Command error '800a0bb9' by Bob

Bob
Mon Aug 16 10:15:27 CDT 2004

R wrote:
> Hi Bob,
> Thanks for the help.
> I've confirms that adParamOutput, adParamInput, adcmdstoredproc are
> all in the adovbs.inc file.
> You are right, the adExecuteNoRecords is not in the file, so, I've
> removed it for now.
> That line just reads ' .Execute' now without the single quotes.
>

Don't remove it: you should be supplying that option. Either add a Const
statement to declare it yourself:

Const adExecuteNoRecords = 128

or use the value:
.Execute ,,128

> Unfortunately the error is the same...
> Any other advice?

Which is line 83?

Confirm that the constants are actually included by using response.write:

<%
Dim objConn
Dim objCmd
Dim txtUser
Dim txtPswd
dim txtloggedout
Const adExecuteNoRecords = 128

'Form Values
txtUser = request.form("txtUserName")
txtPswd = request.form("txtPassword")

<!--include file=adovbs.inc"-->

'debugging code
on error resume next
Response.Write "adParamOutput: "
Response.Write adParamOutput
Response.Write "<BR>"
Response.Write "adParamInput: "
Response.Write adParamInput
Response.Write "<BR>"

on error goto 0
Response.End

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Re: ADODB.Command error '800a0bb9' by R

R
Mon Aug 16 12:19:26 CDT 2004

Thanks Bob,
You've got me on the right track again. Very much appreciated.
I had assumed that the variables were being populated and this doesn't seem
to be the case, so, I need to figure that out.
Still have much to learn obviously.
Thanks,
Rob


"Bob Barrows [MVP]" wrote:

> R wrote:
> > Hi Bob,
> > Thanks for the help.
> > I've confirms that adParamOutput, adParamInput, adcmdstoredproc are
> > all in the adovbs.inc file.
> > You are right, the adExecuteNoRecords is not in the file, so, I've
> > removed it for now.
> > That line just reads ' .Execute' now without the single quotes.
> >
>
> Don't remove it: you should be supplying that option. Either add a Const
> statement to declare it yourself:
>
> Const adExecuteNoRecords = 128
>
> or use the value:
> ..Execute ,,128
>
> > Unfortunately the error is the same...
> > Any other advice?
>
> Which is line 83?
>
> Confirm that the constants are actually included by using response.write:
>
> <%
> Dim objConn
> Dim objCmd
> Dim txtUser
> Dim txtPswd
> dim txtloggedout
> Const adExecuteNoRecords = 128
>
> 'Form Values
> txtUser = request.form("txtUserName")
> txtPswd = request.form("txtPassword")
>
> <!--include file=adovbs.inc"-->
>
> 'debugging code
> on error resume next
> Response.Write "adParamOutput: "
> Response.Write adParamOutput
> Response.Write "<BR>"
> Response.Write "adParamInput: "
> Response.Write adParamInput
> Response.Write "<BR>"
>
> on error goto 0
> Response.End
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>