Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    3

    Question Unanswered: ERROR: String or binary data would be truncated.

    ERROR: String or binary data would be truncated.

    The error:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e57'

    [Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.

    /maxwebportal/inc_footer.asp, line 121

    Thanks for ANY assistance. I'm pretty much new at this. <CHRIS>

    >>>Code Below...Scroll Down for Line 121:



    if exceer=okoame then

    if CurPageInfoChk = "" then
    strOnlineLocation = "Unknown page"
    else
    if CurPageType = "forums" and trim(strRqForumID) <> "" then
    '## Forum_SQL - load the user list
    strSql = "SELECT " & strTablePrefix & "FORUM.F_PRIVATEFORUMS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strRqForumID & " AND F_PRIVATEFORUMS <> 0"

    set rsPrf = my_Conn.Execute(strSql)


    if not (rsPrf.BOF and rsPrf.EOF) then
    isPrivateForum = 1
    else
    isPrivateForum = 0
    end if

    rsPrf.Close
    set rsPrf = nothing

    end if
    if not CurPageInfo () = "" then
    if isPrivateForum = 1 then
    strOnlineLocation = "Private Page"
    else
    strOnlineLocation = CurPageInfo ()
    end if
    else
    strOnlineLocation = "Hidden page"
    end if
    end if

    strOnlineUser = OnlineSQLencode(strOnlineUser)
    strOnlineLocation = OnlineSQLencode(strOnlineLocation)
    strOnlineTimedOut = strOnlineCheckInTime - 1500 'time out the user after 25 minutes
    strSql = "SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.LastChecked"
    strSql = strSql & " FROM " & strTablePrefix & "ONLINE "
    strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "' AND " & strTablePrefix & "ONLINE.UserID='" & strOnlineUser & "'"
    set rsWho = my_Conn.Execute (strSql)

    if rsWho.eof or rsWho.bof then
    ' THEY ARE A NEW USER SO INSERT THERE USERNAME
    on error resume next
    Set objRS2 = Server.CreateObject("ADODB.Recordset")
    strSQL = "INSERT INTO " & strTablePrefix & "ONLINE (UserID,UserIP,DateCreated,CheckedIn,LastChecked,M
    _BROWSE) VALUES ('"
    strSql = strSQL & strOnlineUser & "','" & strOnlineUserIP & "','" & strOnlineDate & "','" & strOnlineCheckInTime & "','" & strOnlineCheckInTime & "','" & strOnlineLocation & "')"
    my_Conn.Execute (strSql)
    if err.number <> 0 then response.write err.number & "|" & err.description
    else
    ' THEY ARE A ACTIVE USER
    strSql = "SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.LastChecked"
    strSql = strSql & " FROM " & strTablePrefix & "ONLINE "
    strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP = '" & strOnlineUserIP & "'"
    set rsLastChecked = my_Conn.Execute (strSql)

    ' LETS UPDATE THE TABLE SO IT SHOWS THERE LAST ACTIVE VISIT
    strSql = "UPDATE " & strTablePrefix & "ONLINE SET M_BROWSE='" & strOnlineLocation & "' , LastChecked='" & strOnlineCheckInTime & "' WHERE UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "'"
    my_Conn.Execute (strSql) << Line 121<<<<<<<

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    basically,... the data you are trying to update using this...

    ' LETS UPDATE THE TABLE SO IT SHOWS THERE LAST ACTIVE VISIT
    strSql = "UPDATE " & strTablePrefix & "ONLINE SET M_BROWSE='" & strOnlineLocation & "' , LastChecked='" & strOnlineCheckInTime & "' WHERE UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "'"

    is too long for the field you are trying to put it into.

    eg you field is a varchar(10) and you are tyring to put "Help me get this right" in there..... and it won't fit...

    So, check your field sizes, check the data you are inserting and soon you will discover what one(s) is wrong.

  3. #3
    Join Date
    Aug 2002
    Location
    india
    Posts
    41
    Originally posted by rokslide
    basically,... the data you are trying to update using this...

    ' LETS UPDATE THE TABLE SO IT SHOWS THERE LAST ACTIVE VISIT
    strSql = "UPDATE " & strTablePrefix & "ONLINE SET M_BROWSE='" & strOnlineLocation & "' , LastChecked='" & strOnlineCheckInTime & "' WHERE UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "'"

    is too long for the field you are trying to put it into.

    eg you field is a varchar(10) and you are tyring to put "Help me get this right" in there..... and it won't fit...

    So, check your field sizes, check the data you are inserting and soon you will discover what one(s) is wrong.

    Generally this mssg comes when the query inserts a record and any one of the column size if it exceeds the input parameter value then this kind fof error happens.
    Ex - tableA is having a coulmn1 varchar(20) if the query is entering a value which is 21 varchar then this type of error may be displayed.

Posting Permissions

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