Forums

ASP

This topic is locked

split large user input into 8000 byte blocks

Posted 06 Feb 2001 13:14:37
1
has voted
06 Feb 2001 13:14:37 rachel ricketts posted:
I want to submit text through an ASP page using a <textarea> and split the input up into 8000 byte blocks across multiple columns of an sql database.

I believe I can put each block into a separate variable (or SP parameter), and then execute the procedure using the visual basic Mid() function to extract the sections.
(see sqlteam.com forum entry - www.sqlteam.com/Forums/topic.asp?TOPIC_ID=2981&FORUM_ID=5&CAT_ID=3&Topic_Title=Processing+Text+%28BLOB%29+datatype+within+a+stored+pr&Forum_Title=Developer

(The <textarea> will be adding a new row to my sql 2000 database)

Then I want to retrieve the blocks of data from the database and piece them back together into a single variable to view it as a whole block of text on an ASP page.

I am fairly new to asp development and I am struggling to code this. I can't find any examples on the net to follow. Can anyone help me out? <img src=icon_smile_sad.gif border=0 align=middle>

Replies

Replied 06 Feb 2001 20:18:55
06 Feb 2001 20:18:55 George Petrov replied:
Why don't you just use one field in your DB and make if type TEXT (on SQL Server). This can hold very large text blocks...

Greetings,
George Petrov
UDzone.com
Replied 08 Feb 2001 17:22:10
08 Feb 2001 17:22:10 rachel ricketts replied:
I have tried that. I seem to be able to input the data ok, as far as I get no errors! But when when i try to pull the recordset into a results asp page, the TEXT field simply doesn't show. All the other fields show - the CHAR, the VARCHAR and the INT fields all show.

Also, when i view the actual database table through Enterprise Manager, what I see in the TEXT field, instead of the data I have just input, is &lt;lONG TEXT&gt;.

What might I be doing wrong <img src=icon_smile_question.gif border=0 align=middle>

Replied 12 Feb 2001 12:38:14
12 Feb 2001 12:38:14 rachel ricketts replied:
I have solved the TEXT problem!

I changed the order of my SELECT statement so that the TEXT field is at the end (instead of the order it appears in the database which places the TEXT field second in the list). This has fixed it!

Cheers <img src=icon_smile_big.gif border=0 align=middle>



Edited by - rachel on 02/12/2001 12:39:25
Replied 12 Feb 2001 19:25:31
12 Feb 2001 19:25:31 George Petrov replied:
Great work Rachel!
I found this a very strange issue - I use large text fields all over UDzone and never had problems with them.

Greetings,
George Petrov
UDzone.com
Replied 13 Feb 2001 10:30:51
13 Feb 2001 10:30:51 rachel ricketts replied:
I did some reading in 'Beginning ASP Databases' WROX publication, where there is a section devoted to using MEMO fields (in Access) and TEXT fields (in SQL server). Apparently this problem of mine is a 'feature' which occurs when you connect to the database through ADO.

If you structure your table so that the TEXT fields are at the end, you can use SELECT *... without problems, otherwise you should list your fields in the SELECT statement placing the TEXT fields at the end of the list.

Hope this helps other people out because it certainly had me tearing my hair out!

Reply to this topic