asp passing input values into stored procedure query

H

Hermes

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 :eek:)
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 = :p_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
 
B

Bob Barrows [MVP]

Hermes said:
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
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top