SitePoint Sponsor

User Tag List

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

    Application uses a value of the wrong type for the current operation

    Hi,

    Can some body please help me figure out what is wrong with this code, i get the following error every time, what's wrong? thanx

    Error Type:
    ADODB.Command (0x800A0D5D)
    Application uses a value of the wrong type for the current operation.
    /dwprojects/newday/Step1.asp, line 33


    Here's my code:

    Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/cnNewDay.asp" -->
    <%
    
    Dim cmNewDay__CustomerName
    cmNewDay__CustomerName = ""
    if(Request.form("CustomerName") <> "") then cmNewDay__CustomerName = Request.form("CustomerName")
    
    Dim cmNewDay__product
    cmNewDay__product = ""
    if(Request.form("product") <> "") then cmNewDay__product = Request.form("product")
    
    Dim cmNewDay__unit_price
    cmNewDay__unit_price = ""
    if(Request.form("unitprice") <> "") then cmNewDay__unit_price = cLng(trim(Request.form("unitprice")))
    
    Dim cmNewDay__quantity
    cmNewDay__quantity = ""
    if(Request.form("quantity") <> "") then cmNewDay__quantity = cLng(trim(Request.form("quantity")))
    
    %>
    <%
    
    set cmNewDay = Server.CreateObject("ADODB.Command")
    cmNewDay.ActiveConnection = MM_cnNewDay_STRING
    cmNewDay.CommandText = "dbo.insert_NewDayOrder"
    cmNewDay.CommandType = 4
    cmNewDay.CommandTimeout = 0
    cmNewDay.Prepared = true
    cmNewDay.Parameters.Append cmNewDay.CreateParameter("@RETURN_VALUE", 3, 4)
    31     cmNewDay.Parameters.Append cmNewDay.CreateParameter("@CustomerName", 200, 1,50,cmNewDay__CustomerName)
    32 cmNewDay.Parameters.Append cmNewDay.CreateParameter("@product", 200, 1,100,cmNewDay__product)
    line 33 cmNewDay.Parameters.Append cmNewDay.CreateParameter("@unit_price", 131, 1,9,cmNewDay__unit_price)
    34cmNewDay.Parameters.Append cmNewDay.CreateParameter("@quantity", 3, 1,4,cmNewDay__quantity)
    cmNewDay.Execute()
    
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    </body>
    </html>
    Also frm the above code line 31 maps to [varchar](50) datatype in the DB
    line 32 maps to [varchar](100) datatype in the DB
    line 33 maps to [numeric] datatype in the DB
    line 34 maps to [int] datatype in the DB
    Last edited by gvd; Jun 14, 2005 at 11:03.

  2. #2
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when u post a thread, pls use the tags

    Second, it would help if you highlight line 33. Which is the page giving you the error.

    Afrika


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
  •