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

    Question Unanswered: 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
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    This error occurs when the data you are inserting into your column exceeds the data width specified for the column. Check your DDL and insert statement to find out the particular column.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

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