Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    124

    Unanswered: update stored procedure

    I'm updating a record using the following SP:

    CREATE PROCEDURE dbo.Sp_Del_Req_Record
    (
    @abrID int,
    @logl_del_dt datetime,
    @phys_del_dt datetime
    )
    AS
    UPDATE DIM_ABR_REQ_DETLS
    SET ABR_DETLS_LOGL_DEL_DT = @logl_del_dt,
    ABR_DETLS_PHYS_DEL_DT = @phys_del_dt
    WHERE ABR_DETLS_ID = @abrID
    GO

    I have the following command code:
    Dim Sp_Del_Req_Record__abrID
    Sp_Del_Req_Record__abrID = ""
    if(Request("AlloFundID") <> "") then Sp_Del_Req_Record__abrID = Request("AlloFundID")

    Dim Sp_Del_Req_Record__logl_del_dt
    Sp_Del_Req_Record__logl_del_dt = ""
    if(Now() <> "") then Sp_Del_Req_Record__logl_del_dt = Now()

    Dim Sp_Del_Req_Record__phys_del_dt
    Sp_Del_Req_Record__phys_del_dt = ""
    if(Now() <> "") then Sp_Del_Req_Record__phys_del_dt = Now()

    %>
    <%

    set Sp_Del_Req_Record = Server.CreateObject("ADODB.Command")
    Sp_Del_Req_Record.ActiveConnection = MM_DBConn_STRING
    Sp_Del_Req_Record.CommandText = "dbo.Sp_Del_Req_Record"
    Sp_Del_Req_Record.CommandType = 4
    Sp_Del_Req_Record.CommandTimeout = 0
    Sp_Del_Req_Record.Prepared = true
    Sp_Del_Req_Record.Parameters.Append Sp_Del_Req_Record.CreateParameter("@RETURN_VALUE", 3, 4)
    Sp_Del_Req_Record.Parameters.Append Sp_Del_Req_Record.CreateParameter("@abrID", 3, 1,4,Sp_Del_Req_Record__abrID)
    Sp_Del_Req_Record.Parameters.Append Sp_Del_Req_Record.CreateParameter("@logl_del_dt", 135, 1,8,Sp_Del_Req_Record__logl_del_dt)
    Sp_Del_Req_Record.Parameters.Append Sp_Del_Req_Record.CreateParameter("@phys_del_dt", 135, 1,8,Sp_Del_Req_Record__phys_del_dt)
    Sp_Del_Req_Record.Execute()

    %>

    I get a wrong data type error thrown at the following line:
    Sp_Del_Req_Record.Parameters.Append Sp_Del_Req_Record.CreateParameter("@abrID", 3, 1,4,Sp_Del_Req_Record__abrID)

    I'm not sure where I am going wrong.
    Any help is appreciated. Thanks.
    -D-

  2. #2
    Join Date
    Dec 2004
    Location
    CA, USA
    Posts
    63
    try specifying the size of the return value:

    CreateParameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0)

  3. #3
    Join Date
    Jan 2004
    Posts
    124
    Thanks for replying to my post. I gave that a try and I still get the same error?

    I'm not sure what I'm missing?

    -D-

  4. #4
    Join Date
    Dec 2004
    Location
    CA, USA
    Posts
    63
    Maybe cause Sp_Del_Req_Record__abrID = ""

    Since it's an int try setting it to a number:

    Sp_Del_Req_Record__abrID = -1 etc....

Posting Permissions

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