Results 1 to 2 of 2

Thread: function to convert CR/LF into HTML from a db memo field

  1. #1
    Danielle Cox Guest

    function to convert CR/LF into HTML from a db memo field

    Does anyone know of a function that will convert carriage returns and line breaks into html. I'm inserting contents from an Access Database memo field and it shows the text all in one long paragraph.

    It is probably something like

    Function showBreaks (str)
    showBreaks = replace (str, chr(10), &#34;&nbsp;<br>&#34
    End Function.

    When I try the above function I either get blank results (it shows me nothing from that field) or I shows the field with out the CR, depending on where I place the funciton.



  2. #2
    John Guest

    function to convert CR/LF into HTML from a db memo field (reply)

    Hi Danielle,

    ASP-db has a neat option that does this for you. For example:

    Mydb.dbOptions = &#34;MemoParagraph=<BR><BR>&#34;

    will put a pair of <BR> tags in place of every CR/LF in your memo field!

    Give it a try. You can even use <HR> or anything you like.

    Take care,
    John



    ------------
    Danielle Cox at 1/21/00 11:57:06 AM

    Does anyone know of a function that will convert carriage returns and line breaks into html. I&#39;m inserting contents from an Access Database memo field and it shows the text all in one long paragraph.

    It is probably something like

    Function showBreaks (str)
    showBreaks = replace (str, chr(10), &#34; <br>&#34
    End Function.

    When I try the above function I either get blank results (it shows me nothing from that field) or I shows the field with out the CR, depending on where I place the funciton.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •