Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Memo Field -- extra spaces, non-printable characters


Message #1 by "jim okane" <thpower@m...> on Fri, 14 Feb 2003 18:22:12
Hi everyone.

Thanks in advance to any and all that offer some insight on this 
wierdness. 

I basically have a message board I wrote that runs on an Access 2000 db 
using ASP. 

When someone initially posts a message, it writes to the db just fine. The 
field is of the type "Memo".  

When that user comes back to edit his post, it appears on the client 
inside a <textarea> tag, and instead of the existing posted text appearing 
in the text box flush in the upper left hand corner of the text box, it 
displays with about 20-50 leading spaces, or a few tabs in front the text 
post. When the user then saves this post, it gets inserted into the 
database with a bunch of squares in front of the actual text. (non-
printable ascii characters?)

Anyone ever see this behavior before, and know a way around it? Is this 
happening becuase the memo field is actually a binary field and its 
putting some sort of wrapper around it? 

How can I get rid of the leading "squares" upon editing a post, and get it 
to display without the leading spaces in the textbox upon editing?

Thanks in advance, 

Joseph Kane
Message #2 by "Ken Schaefer" <ken@a...> on Mon, 17 Feb 2003 16:45:25 +1100
The "little squares" are ASCII tab characters (you can replace them by
searching for vbTab).

They are appearing because there are "tabs" in your HTML source where the
<textarea> element is. Place the <textarea> flush left in your HTML source:

<table>
    <tr>
        <td>
<textarea></textarea>
        </tr>
    </tr>
</table>

I know it looks ugly, but it's the easiest way to get rid of the tabs.
Otherwise, you can eliminate the tabs by doing:

<%
strMessage = Request.Form("txtMyTextArea")
strMessage = Replace(strMessage, vbTab, "")
%>

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "jim okane" <thpower@m...>
Subject: [access_asp] Memo Field -- extra spaces, non-printable characters


: I basically have a message board I wrote that runs on an Access 2000 db
: using ASP.
:
: When someone initially posts a message, it writes to the db just fine. The
: field is of the type "Memo".
:
: When that user comes back to edit his post, it appears on the client
: inside a <textarea> tag, and instead of the existing posted text appearing
: in the text box flush in the upper left hand corner of the text box, it
: displays with about 20-50 leading spaces, or a few tabs in front the text
: post. When the user then saves this post, it gets inserted into the
: database with a bunch of squares in front of the actual text. (non-
: printable ascii characters?)
:
: Anyone ever see this behavior before, and know a way around it? Is this
: happening becuase the memo field is actually a binary field and its
: putting some sort of wrapper around it?
:
: How can I get rid of the leading "squares" upon editing a post, and get it
: to display without the leading spaces in the textbox upon editing?
:

Message #3 by "jim okane" <thpower@m...> on Mon, 17 Feb 2003 09:54:00
Ken, 

I see your posts all over this site. Thanks for taking the time to answer 
mine, and correctly. 

That was exactly it. The formatting of my HTML was causing the problem. 
Moving the whole <textarea> opening and closing tabs on the same line 
fixed it.

I am humbled by such a simple fix to a silly problem. 

Thank you Ken. 

  Return to Index