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

Error Code = 22001 (String data right truncation) ??

Status
Not open for further replies.

potinenip

Programmer
Jul 12, 2000
35
US
Hi All,<br>I don't have any clue what this error is about. I am trying to insert a set of fields in to a table and got this error.<br><br>&lt;CFINSERT dataSource=&quot;PostYourHome&quot; tableName=&quot;Properties&quot; formfields=&quot;PropertyTypeCode,PropertyAddress,PropertyCity,PropertyStateCode,PropertyZipCode,Garage,School,PropertyAge,AvailableMonth,AvailableDate,AvailableYear,PropertyDescription,SaleBy,PropertyPhotoURL&quot;&gt; <br><br>The same form was working fine but next time i got this error.<br>Please help me on this.<br>Praveen<br><br>Error Diagnostic Information<br>ODBC Error Code = 22001 (String data right truncation)<br>[Microsoft][ODBC SQL Server Driver]String data, right truncation<br>The error occurred while processing an element with a general identifier of (CFINSERT), occupying document position (112:1) to (112:265).<br><br>
 
Potinenip,<br><br>&nbsp;&nbsp;Usually this error occurs when one of your fields has a length that is bigger than the size in he database. <br><br>&nbsp;&nbsp;For instance if Property Address is 50 characters in the database and you allow the user to type 60 characters on the screen, when you try to do the insert, the 60 character field will not fit and have to be truncated down to 50 characters. <br><br>&nbsp;&nbsp;The insert will be successful if the user only enters 40 characters in the address.&nbsp;&nbsp;Use MAXLENGTH in the INPUT type to limit the number of characters the user can input.<br><br>Hope this helps.<br><br>&nbsp;&nbsp;&nbsp;Dave Joyce
 
Thanks dave it worked already.<br>Thanks again<br>Praveen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top