SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    store proceedure error

    hello,
    I have a stored proceedure in my db, that inserts a telephone number in my db. Which has 14 characters. My code for the SP is thus

    Code:
    create_sms_history.Parameters.Append create_sms_history.CreateParameter("@Receipient", 3, 1,4,create_sms_history__Receipient)
    however i keep getting this error message

    what could be wrong ?



    Code:
    Provider error '8002000a' 
    
    Out of present range. 
    
    /welcome/welcome/messages/confirm_send.asp, line 254
    thanks

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,260
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    pretty difficult without seeing your stored procedure
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    However i just changed my datatype to Varchar instead of int

    and itworks now, but below is my ASP page and SP
    Thanks Rudy

    rgds
    afrika

    STORE PROCEEDURE


    [dbo].[insert_sms_history_1]
    (@senderID [int],
    @Receipient [int],
    @Username [varchar](20),
    @message [varchar](200),
    @IP [varchar](25))

    AS INSERT INTO [1newday_com_sql].[dbo].[sms_history]
    ( [senderID],
    [Receipient],
    [Username],
    [message],
    [IP])

    VALUES
    ( @senderID,
    @Receipient,
    @Username,
    @message,
    @IP)
    ASP PAGE



    Dim create_sms_history__senderID
    create_sms_history__senderID = "1"
    if(request.form("senderID") <> "") then create_sms_history__senderID = request.form(Cstr("senderID"))

    Dim create_sms_history__Receipient
    create_sms_history__Receipient = "1"
    if(request.Form("phone_nu") <> "") then create_sms_history__Receipient = request.Form(Cstr("phone_nu"))

    Dim create_sms_history__Username
    create_sms_history__Username = "1"
    if(session("MM_Username") <> "") then create_sms_history__Username = session("MM_Username")

    Dim create_sms_history__message
    create_sms_history__message = "1"
    if(Request.form("send_sms") <> "") then create_sms_history__message = Request.form("send_sms")

    Dim create_sms_history__IP
    create_sms_history__IP = "1"
    if(Request.servervariables("remote_addr") <> "") then create_sms_history__IP = Request.servervariables("remote_addr")

    %>
    <%

    set create_sms_history = Server.CreateObject("ADODB.Command")
    create_sms_history.ActiveConnection = MM_mary_STRING
    create_sms_history.CommandText = "dbo.insert_sms_history_1"
    create_sms_history.Parameters.Append create_sms_history.CreateParameter("@RETURN_VALUE", 3, 4)
    create_sms_history.Parameters.Append create_sms_history.CreateParameter("@senderID", 3, 1,20,create_sms_history__senderID)
    create_sms_history.Parameters.Append create_sms_history.CreateParameter("@Receipient", 3, 1,20,create_sms_history__Receipient)
    create_sms_history.Parameters.Append create_sms_history.CreateParameter("@Username", 200, 1,20,create_sms_history__Username)
    create_sms_history.Parameters.Append create_sms_history.CreateParameter("@message", 200, 1,200,create_sms_history__message)
    create_sms_history.Parameters.Append create_sms_history.CreateParameter("@IP", 200, 1,25,create_sms_history__IP)
    create_sms_history.CommandType = 4
    create_sms_history.CommandTimeout = 0
    create_sms_history.Prepared = true
    create_sms_history.Execute()


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
  •