Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Trunkated text


Message #1 by "PaulD" <pauld@b...> on Fri, 12 May 2000 15:11:31
I'm fairly new to ASP so please be gentle.



I have a web page which contains a  form. One of the form element is a text 

area. This text area will have to contain quite a large amount of text.

Through asp the contents of the text area are posted to an Access97 memo 

field.



Everything appears to work quite well except that the text is cut off after 

about 1800 characters. I know that the memo field can hold more but for 

some reason all of the text does not reach that far.

Are there some limits on the amount of data that can be moved from a single 

form element or is there another reason??



Cheers for any help



              Paul..

Message #2 by "Pat Waddington" <paw@s...> on Fri, 12 May 2000 15:07:59 +0100
The problem might lie in the fact that there is a limit of 2000 characters

in a single table entry in Access.



Hope this helps

Pat





----- Original Message -----

From: PaulD 

To: ASP Databases <asp_databases@p...>

Sent: Friday, May 12, 2000 3:11 PM

Subject: [asp_databases] Trunkated text





> I'm fairly new to ASP so please be gentle.

>

> I have a web page which contains a  form. One of the form element is a

text

> area. This text area will have to contain quite a large amount of text.

> Through asp the contents of the text area are posted to an Access97 memo

> field.

>

> Everything appears to work quite well except that the text is cut off

after

> about 1800 characters. I know that the memo field can hold more but for

> some reason all of the text does not reach that far.

> Are there some limits on the amount of data that can be moved from a

single

> form element or is there another reason??

>

> Cheers for any help

>

>               Paul..

Message #3 by Kevin D Riggs <kevin.riggs@p...> on Fri, 12 May 2000 10:30:05 -0400
Paul,





	One thing I had trouble with was tracking down the problems caused by

apostrophes (') and quotes (").  When you enter data into the Access97

database, you should use the Replace function.  The problem I had was

that my ASP script was delineated by quotes (") and it mistook the

apostrophes as comments.  This could get to be a pain so sometimes I

would use the Response.Write strSQL before I tried to execute it.  Once

you finish troubleshooting, don't forget to remove the Response.Write

test.







>>>>>>>>>>>>>>>>>>Code 

Snippet<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<&
lt;<<<<<<<<<<





Dim strSQL, strUsername, datWorkDate, strWorkPerformed, etc





strUsername = "'" & Request.Form("username") & "'"



datWorkDate = Request.Form("date")



<color><param>ffff,0000,0000</param>strWorkPerformed 

Replace(Request.Form("workperformed"), "'", "''")



</color>



strSQL = "INSERT INTO tblTablename (username, workdate, workperformed)_



 VALUES (" & strUsername & ", " & datWorkDate & ", " & strWorkPerformed &

";)"





'You could perform a quick test here by Response.Write the strSQL and see

that



'all the data has made it into the strSQL variable.





cmdInsert.CommandText = strSQL





If cmdInsert.Execute Then



	Response.Write "Thank you for helping us track the workload for

Technology_



	.<<br>" & vbCrLf





	Response.Write "Your work order has been entered." & vbCrLf





Else



	Response.Write "There was some problem entering your work into the_



	database.  Please contact the <<a

href='mailto:me@m...'>administrator_



	<</a> for further assistance and problem tracking.<<br><<br>Please

have_



	this work order number to help in solving the problem." & vbCrLf



End If





>>>>>>>>>>>>>>>>>>>>>End

Snippet<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<&
lt;<<<<<<<<<<<<<<<<<<<<<<<<<<<<





	If your e-mail client can see color, then the red line above is the one

you want to notice.  You can nest the replace command so that you might

use:





strWorkPerformed = Replace(Replace(Request.Form("workperformed"), "'",

"''"), """, """")









Hope you find this helpful,





KD











Kevin D Riggs





kevin.riggs@p...



AOL IM - "wsi tn"





Senior Network Administrator & Webmaster



Rhea County



Board of Education





http://www.rhea.k12.tn.us/



http://www.rheacounty.org/


  Return to Index