Ask a Question related to ASP Database, Design and Development.
-
Arnaldo Cabral #1
SQL error '80040e21' when adding more text than the Field can handle
I have a field in a table called description. I set the lenght to
7000 characters and the datatype to char on the description field.
Problem is that some people are putting more than 7000 characters into
the description field and are getting the error below. How can I
resolve this?
ERROR BELOW:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
/kb/kb/submitadd.asp, line 80
Arnaldo Cabral Guest
-
Adding Text to a PDF Doc. [Compiler Error]using PDETextAdd () Method
Hi, I'm trying to add some text to a PDF using the PDETextAdd() Method, but for some reason it doesn't recognize the first four parameters... ... -
adding servlet-mapping to handle any request
Is there a wildcard that i can add to the web.xml file in the servlet-mapping section so coldfusion mx will handle all requests that are passed to... -
Login User User Error 80040e21
I am getting an 80040e21 error using the log in user server behavior. The complete error message is Microsoft OLE DB Provider for SQL Server... -
Adding text to dynamic text field
When loading text from an external text file into a dynamic text field using the following Action Script: Features_lv = new LoadVars();... -
Error 80040e21 - Received when setting a new record's values
I am opening a connection to my Table via the recordset object. I have poured over it, but i can't seem to find the issue. I consistently... -
Aaron Bertrand [MVP] #2
Re: SQL error '80040e21' when adding more text than the Field can handle
>I have a field in a table called description. I set the lenght to
Before you send it to the database, trim it to 7000 characters. You can do> 7000 characters and the datatype to char on the description field.
> Problem is that some people are putting more than 7000 characters into
> the description field and are getting the error below. How can I
> resolve this?
this in VBScript/ASP by saying:
sql = "INSERT ... VALUES('" & left(var, 7000) & "')"
Instead of:
sql = "INSERT ... VALUES('" & var & "')"
You should also consider handling this validation on the client side
beforehand, so users aren't surprised when their content was silently
trimmed on them.
BTW, datatype should be VARCHAR, not CHAR. Unless everyone is expected to
enter *exactly* 7000 characters.
[url]http://www.aspfaq.com/2354[/url]
I'd also be interested in the code (both ASP and SQL) that causes this
error. What you *should* have received is:
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Which would translate in ASP as:
Microsoft OLE DB Provider for SQL Server error '80040e57'
String or binary data would be truncated.
See [url]http://www.aspfaq.com/2289[/url] for more information.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
Aaron Bertrand [MVP] Guest
-
Ray at #3
Re: SQL error '80040e21' when adding more text than the Field can handle
Function TextIn(theText, theMaxLength)
Dim sResult
sResult = theText
If Len(sResult) > theMaxLength Then sResult = Left(sResult,
theMaxLength)
sResult = "'" & Replace(sResult, "'", "''") & "'"
End Function
sValue = Request.Form("textfield")
sSQL = "EXEC YourProcedure " & TextIn(sValue,7000)
Ray at work
"Arnaldo Cabral" <wwwacny@yahoo.com> wrote in message
news:63108917.0404130911.60dec2c0@posting.google.c om...> I have a field in a table called description. I set the lenght to
> 7000 characters and the datatype to char on the description field.
> Problem is that some people are putting more than 7000 characters into
> the description field and are getting the error below. How can I
> resolve this?
>
>
>
> ERROR BELOW:
>
> Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
>
> Multiple-step OLE DB operation generated errors. Check each OLE DB
> status value, if available. No work was done.
>
> /kb/kb/submitadd.asp, line 80
Ray at Guest



Reply With Quote

