command problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Savas Ates

    command problem

    it doesnt work still

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


    <!--#include file="conn.asp"-->
    <%
    Set cmd=server.Crea teObject("ADODB .Command")
    cmd.CommandType =4
    cmd.ActiveConne ction=baglantim
    cmd.CommandText = "st_myfrien ds"
    cmd.Parameters. Append
    cmd.CreateParam eter("@UserId", adNumeric, adParamInput, ,50)
    Set objRS = objCommand.Exec ute
    %>

    cmd.CommandType =4
    or
    cmd.CommandType =adCmdStoredPro c

    both gives same error


  • Bob Barrows [MVP]

    #2
    Re: command problem

    Savas Ates wrote:[color=blue]
    > it doesnt work still
    >
    > Arguments are of the wrong type, are out of acceptable range, or ...
    >[/color]
    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

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


    Comment

    • Savas Ates

      #3
      Re: command problem

      <!--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.Crea teObject("ADODB .Command")
      cmd.ActiveConne ction=baglantim
      cmd.CommandType =4
      Set Parm = cmd.CreateParam eter("@userid" , adNumeric, adParamInput ,0,10)

      cmd.Parameters( "@userid").Valu e= 10

      cmd.Parameters. Append Parm

      cmd.CommandText = "st_myfrien ds"
      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=bag lantim.execute ("st_myfrien ds @userid='10"'")

      this works





      Comment

      • Jeff Dillon

        #4
        Re: command problem

        What about adNumeric and adParamInput??

        Jeff
        "Savas Ates" <savas@indexint eractive.com> wrote in message
        news:#NgJ5LpvEH A.3896@TK2MSFTN GP09.phx.gbl...[color=blue]
        > it doesnt work still
        >
        > Arguments are of the wrong type, are out of acceptable range, or ...
        >
        >
        > <!--#include file="conn.asp"-->
        > <%
        > Set cmd=server.Crea teObject("ADODB .Command")
        > cmd.CommandType =4
        > cmd.ActiveConne ction=baglantim
        > cmd.CommandText = "st_myfrien ds"
        > cmd.Parameters. Append
        > cmd.CreateParam eter("@UserId", adNumeric, adParamInput, ,50)
        > Set objRS = objCommand.Exec ute
        > %>
        >
        > cmd.CommandType =4
        > or
        > cmd.CommandType =adCmdStoredPro c
        >
        > both gives same error
        >
        >[/color]


        Comment

        Working...