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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What causes this? String or binary data would be truncated.

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
US
Could someone tell me what causes this and/or how to fix it. This is the full message.

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

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

/HTMLpages/toolbars/credit_investigations/letterchoice.asp, line 69

and this is the code.


sqlString = "INSERT INTO CustInfo (RecordDate, ACSUserID, Department, Unit, LetterType, SubLetterType, AccountNumber,AccountBalance, FirstName, "
sqlString = sqlString & "MI, LastName)"
sqlString = sqlString & " VALUES ('" & today & "','" & acsuserid & "','" & department & "', '" & unit & "', '" & lettertype & "'"
sqlString = sqlString & ", '" & lettersubtype & "','" & acctnum & "', CAST ('" & acctbal & "' as Money), '" & firstname & "', '" & middleinit & "'"
sqlString = sqlString & ", '" & lastname & "')"


SET RS = Conn.Execute( sqlString )

Is it a field that Im missing. Because it is part of an if statement but the value is not being inserted into the DB.
 
You're trying to put some data into a column that can't hold it.

For instance, trying to put the string:

"hello, this is a string"

into a column with a data type of varchar(5)

Check out all your data types and lengths to find out what column is the culprit.

:)
paul
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top