command problem

S

Savas Ates

it doesnt work still

Arguments are of the wrong type, are out of acceptable range, or ...


<!--#include file="conn.asp"-->
<%
Set cmd=server.CreateObject("ADODB.Command")
cmd.CommandType=4
cmd.ActiveConnection=baglantim
cmd.CommandText = "st_myfriends"
cmd.Parameters.Append
cmd.CreateParameter("@UserId", adNumeric, adParamInput, ,50)
Set objRS = objCommand.Execute
%>

cmd.CommandType=4
or
cmd.CommandType=adCmdStoredProc

both gives same error
 
B

Bob Barrows [MVP]

Savas said:
it doesnt work still

Arguments are of the wrong type, are out of acceptable range, or ...
This always means that the ADO constants you are using are not defined. You
could #include the adovbs.inc file, but that is not very efficient. See
http://www.aspfaq.com/show.asp?id=2112 for a better way to provide the
definitions of the contants.

Bob Barrows
 
S

Savas Ates

<!--METADATA TYPE="typelib"
NAME="Microsoft ActiveX Data Objects 2.8 Library"
UUID="{2A75196C-D9EB-4129-B803-931327F72D5C}"
VERSION="2.8"-->
<!--#include file="conn.asp"-->

<%
Set cmd=server.CreateObject("ADODB.Command")
cmd.ActiveConnection=baglantim
cmd.CommandType=4
Set Parm = cmd.CreateParameter("@userid" , adNumeric, adParamInput ,0,10)

cmd.Parameters("@userid").Value= 10

cmd.Parameters.Append Parm

cmd.CommandText = "st_myfriends"
cmd.Execute

'adCmdText
cmd.CommandType = adCmdText
cmd.CommandText = "exec st_Insert @userid = 10"
cmd.Execute
%>

it gives
ADODB.Command (0x800A0CC1)
item cannot be found in db it says

im sure it exists coz
set rsmyfriends=baglantim.execute ("st_myfriends @userid='10"'")

this works
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top