SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with ASP Stored Procedure Call

    Hey all,

    I am getting the following error message:
    Code:
    ADODB.Command error '800a0d5d'
    
    Application uses a value of the wrong type for the current operation.
    When trying to execute this code:
    Code:
    <%
    Const bimDataSrc = (Omitted)
    
       Set cn = Server.CreateObject("ADODB.Connection")
       cn.Open bimDataSrc
       Set cmd = Server.CreateObject("ADODB.Command")
       Set cmd.ActiveConnection = cn
       cmd.CommandText = "Cameos_Insert"
       cmd.CommandType = adCmdStoredProc
       cmd.Parameters.Append cmd.CreateParameter("RetVal", adInteger, _
          adParamReturnValue)
       cmd.Parameters.Append cmd.CreateParameter("Param1", adInteger, _
          adParamInput)
       cmd.Parameters.Append cmd.CreateParameter("Param2", adInteger, _
          adParamInput)
       ' Set value of Param1 of the default collection to 22
       cmd("Param1") = 7777
       cmd("Param2") = "'Testing'"
       cmd.Execute
    %>
    However, It works when I change the second to last line to:
    Code:
    cmd("Param2") = 8888

    Isn't this the proper way to pass in a string? It should accept a string since the stored procedure it's calling accepts two variables, in the following format:
    Code:
    (@custID int, @cameo nvarchar(2000))
    ? ?

  2. #2
    SitePoint Member
    Join Date
    Jan 2010
    Location
    Keene, NH
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your code is expecting an integer for Parm2.

    Look here at Section 4
    http://authors.aspalliance.com/steve...les/sprocs.asp

    You should be using adVarChar
    Regards,
    Kim(Kman)
    www.toocoolwebs.com

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,227
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)
    Is the database field type correct and your code is trying to pass an incorrect type?
    Or is your code correct and your database has the wrong type?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •