Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

0x80040E57 error inserting data into a table.

Status
Not open for further replies.

qwert231

Programmer
Sep 4, 2001
756
US
I get an error:
Microsoft OLE DB Provider for SQL Server (0x80040E57)
String or binary data would be truncated.

When I try to insert data into a database table. Here is the code I am using.

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open strC
Conn.Execute(insString)
Conn.Close
Set Conn = Nothing

insString = "INSERT INTO OrderItems(OrderID, ProductID, Quantity, Sequence, JobPath, PrinterName) VALUES ('Y10019','YBK-C-DLS','1','1','MP-1','\\Dell2400\KPDP2\OrderJobs\Y10019\Job_Y10019_1')"
 
I've seen this before. The value you are trying to insert in one of those fields is too large. Usually it happens when you try to insert into a character field (either char or varchar) and the string is greater than the maximum defined size for that field. It can happen with a number too, but that doesn't happen very often because even the integer datatype can hold very large numbers anymore (maybe you are using a smallint field?). Check out the field definitions for the ones you are trying to insert (if there are other fields they are either getting the default value or NULL since you aren't explicitly referencing them, and that shouldn't cause this problem.
 
Sorry... I figured it out. Thanks. (I had the fields crossed.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top