Google Answers Logo
View Question
 
Q: Line breaks in Access memo fields on a webpage ( Answered,   0 Comments )
Question  
Subject: Line breaks in Access memo fields on a webpage
Category: Computers
Asked by: elfynet-ga
List Price: $2.50
Posted: 19 Jun 2003 01:35 PDT
Expires: 19 Jul 2003 01:35 PDT
Question ID: 219127
My website is in ASP VBscript, hosted on a Microsoft Server. 
I want to introduce a forum, powered by an Access database. Users
submit their messages in a memo field. They are not familiar with html
so they can’t be requested to enter html tags to render line breaks.
Is there an alternative solution to render the line breaks?
Answer  
Subject: Re: Line breaks in Access memo fields on a webpage
Answered By: hammer-ga on 19 Jun 2003 04:53 PDT
 
Elfynet,

You need to replace the line breaks with "<BR>" before storing the
memo value in your database.

Replace(RS(Memofield1), Chr(13), "<BR>")

Chr(13) is the ASCII value for a carriage return. Use the Replace
function to replace it with the HTML code for a line break (<BR>).
When you display the altered value on your web page, everywhere the
user pressed the Enter key will be replaced with <BR>, and the browser
should display it properly.


Google Search Strategy:
ASP access HTML "line breaks" memo


Good luck with your ASP project!

- Hammer

Request for Answer Clarification by elfynet-ga on 19 Jun 2003 07:10 PDT
Users post their question directly on our website. 
The forum is not moderated so their contribution is reflected direclty
on the page. I can't process it with a find and replace manually
before it appears. As well users do not know html so they cannot be
requested to use the <br> tag. What I wonder is if I can automatically
render the line breaks without having to modify the source file.

Clarification of Answer by hammer-ga on 19 Jun 2003 07:18 PDT
You don't do it manually. You are running some code to collect the
information from the form and put it in the Access database and/or
display it when the user hits the Post button. Add the Replace call to
whatever chunk of code you are using to do this. Take a look at this
example on ExpertsExchange:

ExpertsExchange
Title: Textarea get correct CR
http://www.experts-exchange.com/Developer/Web/Web_Languages/ASP/Q_20008373.html


- Hammer
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy