asp passing input values into stored procedure query

Discussion in 'ASP General' started by Hermes, Sep 12, 2004.

  1. Hermes

    Hermes Guest

    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
     
    Hermes, Sep 12, 2004
    #1
    1. Advertising

  2. 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"
     
    Bob Barrows [MVP], Sep 12, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Hoge
    Replies:
    1
    Views:
    16,836
    Ken Cox [Microsoft MVP]
    May 12, 2004
  2. John Smith
    Replies:
    1
    Views:
    1,235
    Brock Allen
    Jun 17, 2005
  3. =?Utf-8?B?TWlrZQ==?=
    Replies:
    0
    Views:
    754
    =?Utf-8?B?TWlrZQ==?=
    Jun 22, 2005
  4. Mike P
    Replies:
    0
    Views:
    3,314
    Mike P
    Jun 19, 2006
  5. Replies:
    1
    Views:
    328
    Keith Patrick
    Jan 5, 2007
Loading...

Share This Page