ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 14th, 2003, 11:48 PM
WebCityTech WebCityTech is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Hudson County- NJ
Posts: 3 WebCityTech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy [Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncat

Hello All,

I need help with inserting a record into my MS SQL server DB table. I am using the cmd.Execute method of the command object after I assign the SQL string value to the cmd.CommandText property. The ASP page that I am using will perform my ADO functions to insert a new member to my website...

What can I be doing wrong if I get the following message when I submit my user's registration HTML page to my registration.asp....

Microsoft OLE DB Provider for ODBC Drivers error '80040e57'
[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.


again,
thanks for your help guys..

Reply With Quote
  #2  
Old June 14th, 2003, 11:55 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
This means that you are trying to insert a string which is bigger than the defined field size.

Reply With Quote
  #3  
Old February 4th, 2004, 02:35 PM
sschroeder sschroeder is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 sschroeder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
but how to figure out which field has the problem?

Quote:
Originally Posted by stumpy
This means that you are trying to insert a string which is bigger than the defined field size.


But is there an easy way of finding out which field has the problem? SQL Server message isn't very specific....

Reply With Quote
  #4  
Old February 4th, 2004, 06:25 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
Yes, perform a len() check on any fields you think might be causing the problem. That is, response.write then len() value to screen before you perform the SQL. Then go and check those values against your DB table.

You should be performing len() checks anyway, so this error doesn't occur. Also, use the maxlength attribute in your HTML forms as an extra check.

Reply With Quote
  #5  
Old February 4th, 2004, 06:56 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 16
Send a message via MSN to aspnewbie
Your error page should also give you the line that the error occurred. Check that line - I'm assuming it probably reads: .parameters(@para) = strvarible, or something along those lines. So that would be the field that is too small to hold all the text you are trying to put in.

Reply With Quote
  #6  
Old June 18th, 2004, 01:06 PM
Kalyani Kalyani is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 Kalyani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
error message in access VB

I have a database that runs on access 97 with VB script.
sometimes when a user enters data in, an error message
[Microsoft][ODBC SQL Server Driver] string data, right truncation(#0)
comes. could this also be due to field length? if so, how can I find out which field it is?

Reply With Quote
  #7  
Old June 18th, 2004, 01:24 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 16
Send a message via MSN to aspnewbie
Yes, it is probably because the user entered more characters than the field allowed. Open up the access database, click on the table, find the field and check it's character length. You might want to add a maxlength to the field on the form to prevent the user from entering more characters than is allowed in the db.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > [Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncat


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap