//  home   //  advanced search   //  news   //  categories   //  sql build chart   //  downloads   //  statistics
 ASP FAQ 
Home
ASP FAQ Tutorials

   8000XXXX Errors
   Alerts
   ASP.NET 2.0
   Classic ASP 1.0
   Databases
   General Concepts
   Search Engine Optimization (SEO)

Contact Us
Site Map

Search

Web
aspfaq.com
tutorials.aspfaq.com

ASP FAQ Tutorials :: 8000XXXX Errors :: Why do I get 80040E57 / 80040E07 errors?


Why do I get 80040E57 / 80040E07 errors?

When dealing with CHAR/VARCHAR columns, and not validating user input, you may have come across this error: 
 
Microsoft OLE DB Provider for SQL Server error '80040e57' 
String or binary data would be truncated. 
 
or 
 
Microsoft JET Database Engine (0x80040E57) 
The field is too small to accept the amount of data you attempted to add. 
Try inserting or pasting less data. 
 
or 
 
Microsoft OLE DB Provider for ODBC Drivers error '80040e57' 
[Microsoft][ODBC Microsoft Access Driver]Invalid string or buffer length.
 
Typically, this is caused by trying to insert too many characters into a defined column. For example: 
 
CREATE TABLE #foo (bar CHAR(5)) 
INSERT #foo(bar) VALUES('yoohoo')
 
A couple of easy fixes include: 
  • using client-side methods (e.g. MAXLENGTH or JavaScript) to prevent such data from being submitted;
  • adjusting the column definition(s) to accommodate for likely data lengths;
  • adjusting the incoming data to fit the column definition, e.g.: 
     
    <% 
        bar = replace(left(request.form("bar"),5),"'","''") 
        sql = "INSERT #foo(bar) VALUES('" & bar & "')" 
        ' ... 
    %>
There may be another reason for this symptom, if you are seeing this error from ASP but do not see it in native tools; for example, Query Analyzer. You can alleviate this by making SET database options consistent -- see KB #255765 for more information. 
 

 
Microsoft OLE DB Provider for ODBC Drivers error '80040e57'  
[Microsoft][ODBC Microsoft Access Driver]Numeric value out of range (null)
 
Check that you are inserting valid numbers into numeric columns. These should not contain any non-numeric characters, and should not be enclosed in quotes. 
 

 
Microsoft JET Database Engine error '80040e57' 
Overflow
 
Make sure you are inserting numeric values into a numeric column, and that it doesn't exceed the capacity of the column. For example, 3,000,000,000 won't fit in a standard Access numeric (or SQL Server INT) column. 
 

 
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'  
[Microsoft][ODBC SQL Server Driver][SQL Server] 
The conversion of a CHAR data type to a DATETIME data type resulted in an 
out-of-range DATETIME value. 
 
or 
 
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'  
[Microsoft][ODBC SQL Server Driver][SQL Server] 
The conversion of CHAR to DATETIME resulted in a DATETIME value out of range. 
 
or 
 
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'  
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. 
 
or 
 
Microsoft JET Database Engine error '80040e07' 
Data type mismatch in criteria expression.
 
This error usually happens when you do one of the following things:
  • attempt to insert a date in Access with ' delimiters;
  • attempt to insert a date in SQL Server with # delimiters;
  • attempt to insert a date in Access or SQL Server with no delimiters; or,
  • attempt to insert a malformed date.

 
If you are using a TEXT column for the first time, you might find that it does not behave the same as CHAR/VARCHAR. You might come across an error like this: 
 
Microsoft OLE DB Provider for SQL Server (0x80040E07) 
Argument data type text is invalid for argument 1 of len function.
 
See Article #2061 for a list of workarounds to using standard string functions against TEXT columns.

Related Articles

Why do I get 8002000A errors?
Why do I get 80040200 / 80040514 / 800A0E7A errors?
Why do I get 80040e09 errors?
Why do I get 80040E0C errors?
Why do I get 80040E10 errors?
Why do I get 80040E14 errors?
Why do I get 80040E21 errors?
Why do I get 80040E23 errors?
Why do I get 80040E24 errors?
Why do I get 80040E2F errors?
Why do I get 80040e30 errors?
Why do I get 80040E31 errors?
Why do I get 80040E37 errors?
Why do I get 80040e4e errors?
Why do I get 80040E54 errors?
Why do I get 8004D00A errors?
Why do I get 80070070 errors?
Why do I get 800A01FB errors?
Why do I get 800A0BB9 / 800A1391 errors?
Why do I get 800A0C93 errors?
Why do I get 800a0cb3 errors?
Why do I get 800A0CC1 errors?
Why do I get 800A0E78 errors?
Why do I get 800A0E7C errors?
Why do I get 800A0E7D errors?
80004005 Errors
Can I use the NZ() function without getting 80040E14 errors?

 

 


Created: 4/22/2002 | Last Updated: 9/14/2002 | broken links | helpful | not helpful | statistics
© Copyright 2006, UBR, Inc. All Rights Reserved. (124)

 

Copyright 1999-2006, All rights reserved.
Finding content
Finding content.  An error has occured...