Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > asp passing input values into stored procedure query

Reply
Thread Tools

asp passing input values into stored procedure query

 
 
Hermes
Guest
Posts: n/a
 
      09-12-2004
Hi Everyone,

I'm using the following asp to execute an SQL query and I'm trying to pass
input variables into the stored procdure but I'm getting
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

I wouldnt be surprised if its my coding lol )
ASP file contents;
<%
set myconn=createobject("adodb.connection")
myconn.Open "Provider=MSDAORA; Data Source=DSN;" & _
"User ID=username;" & "Password=password"
Set cmd = Server.CreateObject ("ADODB.Command")
Set cmd.ActiveConnection = myconn
cmd.CommandText = "SELECT * from sites where site_code = _code "
cmd.CommandType = 1
Set param = cmd.CreateParameter ("p_code", adInteger, adParamInput)
cmd.Parameters.Append param
cmd("p_code") = 10
set rs=myconn.execute

........ the usual display and loop on the rs.
%>
Any ideas?
TIA
Hermes


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-12-2004
Hermes wrote:
> Hi Everyone,
>
> I'm using the following asp to execute an SQL query and I'm trying to
> pass input variables into the stored procdure but I'm getting
> ADODB.Command (0x800A0BB9)
> Arguments are of the wrong type, are out of acceptable range, or are
> in conflict with one another.
>


This means that you are using ADO constants (adInteger, etc.) on your page
without defining them. One way to define them is to #include adovbs.inc on
your pages that need to use the constants, A better way is described here:

http://www.aspfaq.com/show.asp?id=2112


Bob Barrows
--
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"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing values to Stored Procedure vncntj@hotmail.com ASP .Net 1 01-05-2007 09:20 PM
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
Error while passing input parameters to stored procedure using DAA =?Utf-8?B?TWlrZQ==?= ASP .Net 0 06-22-2005 07:44 PM
Passing Dynamic Values to a Stored Procedure with selectparameters John Smith ASP .Net 1 06-17-2005 03:32 PM
Passing null values to a SQL Stored Procedure. John Hoge ASP .Net 1 05-12-2004 07:20 PM



Advertisments