Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Storing multi paragraphed "Memo's" in a database (Access)

Storing multi paragraphed "Memo's" in a database (Access)

Scheduled Pinned Locked Moved ASP.NET
databasequestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tristan Rhodes
    wrote on last edited by
    #1

    I've got a posting system where you type your spiel into a text area, much like this posting system works. It stores this into a memo in an access database. But when i pull it out to put it in a post, it's all in one big chunk of text. What can i do to maintain formatting? Cheers Cata

    M T 2 Replies Last reply
    0
    • T Tristan Rhodes

      I've got a posting system where you type your spiel into a text area, much like this posting system works. It stores this into a memo in an access database. But when i pull it out to put it in a post, it's all in one big chunk of text. What can i do to maintain formatting? Cheers Cata

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Hi Cata. Well, you could just store the html formatting tags in your memo field as text too - Access wouldn't care, it would just treat it as text.

      T 1 Reply Last reply
      0
      • M Mike Ellison

        Hi Cata. Well, you could just store the html formatting tags in your memo field as text too - Access wouldn't care, it would just treat it as text.

        T Offline
        T Offline
        Tristan Rhodes
        wrote on last edited by
        #3

        Ahhh, i thought it might have been something like that. But what do i do, i don't want people to have to insert HTML tags into the text. I could, i suppose, change the insert textbox fetch, into a function call that inserts the HTML

        tags... That about right? Cata

        M 1 Reply Last reply
        0
        • T Tristan Rhodes

          Ahhh, i thought it might have been something like that. But what do i do, i don't want people to have to insert HTML tags into the text. I could, i suppose, change the insert textbox fetch, into a function call that inserts the HTML

          tags... That about right? Cata

          M Offline
          M Offline
          Mike Ellison
          wrote on last edited by
          #4

          The Catalyst wrote: But what do i do, i don't want people to have to insert HTML tags into the text Hi Cata. That's interesting... how are your users entering the formatted text now? I assumed (perhaps incorrectly :) ) that the source for the memo field was web-based data entry in something like a <textarea>.

          T 1 Reply Last reply
          0
          • M Mike Ellison

            The Catalyst wrote: But what do i do, i don't want people to have to insert HTML tags into the text Hi Cata. That's interesting... how are your users entering the formatted text now? I assumed (perhaps incorrectly :) ) that the source for the memo field was web-based data entry in something like a <textarea>.

            T Offline
            T Offline
            Tristan Rhodes
            wrote on last edited by
            #5

            The text wasn't formatted. It was in a text area. I put together a little DLL that prefixes "

            " and post fixes "

            " at the beginning and end of the document. Then replaces all instances of "\n" with "

            " It's worked fine :) I'm curious, in asp.net, can people input script via a text box? I assume that if the page runs anything pulled from text, it could contain complex HTML or Javascript designed to screw a site up, but this wouldn't work with server side script would it? Seing how it has to be compiled.... Just curious Cata

            1 Reply Last reply
            0
            • T Tristan Rhodes

              I've got a posting system where you type your spiel into a text area, much like this posting system works. It stores this into a memo in an access database. But when i pull it out to put it in a post, it's all in one big chunk of text. What can i do to maintain formatting? Cheers Cata

              T Offline
              T Offline
              Tony Archer
              wrote on last edited by
              #6

              This is the definitive answer. TextArea boxes in forms generate vbCrLf's (carriage return line feeds) every time you hit enter. So 2 hits of the enter button and you have a new paragraph. Well, sounds like you're just storing the raw data into Access and then pulling it out onto the page. IF you do that there will be no formatting displayed. But if you look at your source you will see that the returns are there. So, what you do is leave it formated as is in the database. Change the display page code to look like: <% myData = rs.Field("somefield").value 'The below line could just replace with a "< B R >" but I like to keep the return as well as it makes for easier reading of the source code myData = replace(myData, vbCrLf, "< b r >" & vbCrLf) response.write(myData) %> Obviously the < b r > has no spaces. it wasn't showing in the paost without them. --Tony Archer "I can build it good, fast and cheap. Pick any two."

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups