ASP String limit

J

Jay

I have an HTML form with a textarea. When passing large
amount of data in the textarea, the Processing asp pages
catch an error message as follows:
Error Type:
(0x80020009)
Exception occurred.

The error is generated once the trim or length or replace
function is called on the field when long text is passed
in the textarea.
Is there a max limit on the string length that these
functions can process?
What else can be done to done to fix this problem?

Thank you,
 
E

Evertjan.

Jay wrote on 07 sep 2003 in microsoft.public.inetserver.asp.general:
I have an HTML form with a textarea. When passing large
amount of data in the textarea, the Processing asp pages
catch an error message as follows:
Error Type:
(0x80020009)
Exception occurred.

The error is generated once the trim or length or replace
function is called on the field when long text is passed
in the textarea.
Is there a max limit on the string length that these
functions can process?
What else can be done to done to fix this problem?

If it is an ASP serverside code problem, post the code.

If not, ask a clientside NG.
 
J

Jay

The problem is when I call the following function that I
have created:

Function Clean(InString)

Clean=Replace(TRIM(InString), "'", "''", 1, -1, 1)

End Function

The function works well if the data passed is "small".
However when I pass larger values I get the exception. I
think larger is more than 5000 char. I have not yet
tested for the max number of char that I can pass.

I'm using Windows XP with IIS ver 5.1
Your help is highly appreciated.

Thank you,
Jay
 
J

Jay

The problem is when I call the following function that I
have created:

Function Clean(InString)

Clean=Replace(TRIM(InString), "'", "''", 1, -1, 1)

End Function

The function works well if the data passed is "small".
However when I pass larger values I get the exception. I
think larger is more than 5000 char. I have not yet
tested for the max number of char that I can pass.

I'm using Windows XP with IIS ver 5.1
Your help is highly appreciated.

Thank you,
Jay
 
E

Evertjan.

Jay wrote on 07 sep 2003 in microsoft.public.inetserver.asp.general:
Evertjan wrote
The problem is when I call the following function that I
have created:

Function Clean(InString)
Clean=Replace(TRIM(InString), "'", "''", 1, -1, 1)
End Function

The function works well if the data passed is "small".
However when I pass larger values I get the exception. I
think larger is more than 5000 char. I have not yet
tested for the max number of char that I can pass.

I'm using Windows XP with IIS ver 5.1

[please do not underquote]

An interesting question.

============

1
Since we are now on a ASP Newsgroup(NG) I surmize you are using
serverside ASP VBscript.

So the content of the Instring has to be brought from somware. If itis
passed from a form/get the maximum is 4000 chars, I think, if it is a
form/post the maximum could be 5000, I wouldn't know.

Perhaps that is the error bug.

================

2
You could always use a brute force equivalent of your function for
testing if the error is in your function:

Function Clean(InString)
InString = trim(InString)
clean = ""
for i=1 to len(InString)
clean = clean + mid(InString,i,1)
if mid(InString,i,1)="'" then clean = clean + "'"
next
End Function

slow, but reliable [I hope, not tested]
 
E

Egbert Nierop \(MVP for IIS\)

Jay said:
I have an HTML form with a textarea. When passing large
amount of data in the textarea, the Processing asp pages
catch an error message as follows:
Error Type:
(0x80020009)
Exception occurred.

The error is generated once the trim or length or replace
function is called on the field when long text is passed
in the textarea.
Is there a max limit on the string length that these
functions can process?
What else can be done to done to fix this problem?

Thank you,
The solution is quite simple.
Don't use Replace :)

Imagine I have a HTML form,
I would just fetch the data and store it in SQL using a parameter

--- this line is convenient in Global.asa
<!-- METADATA NAME="Microsoft ActiveX Data Objects 2.5 Library"
TYPE="TypeLib"
UUID="{00000205-0000-0010-8000-00AA006D2EA4}" -->



Set cmd = CreateObject("ADOB.Command")
cmd.commandtype = adCmdText
cmd.commandtext = "INSERT INTO myTable (myBIGTEXT) VALUES(?)"
Set cmd.activeconnection = conn
cmd.Parameters.append cmd.createparameter(, adLongVarWChar, , 10000,
MyValue) ' or adLongVarChar if you don't use unicode texts...
cmd.execute , , adExecuteNoRecords
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top