Format Text field from SQL DB

Results 1 to 3 of 3

Thread: Format Text field from SQL DB

  1. #1
    Join Date
    Dec 1969
    Posts
    52

    Default Format Text field from SQL DB

    How do you format a text field from a SQL 6.5 DB?<BR>I have an ASP form that returns the text field, but it does not recognize the carriage returns(the text is returned as one long unformatted string)<BR>Is there a way I could write script looking for vbcrlf&#039s and return a <BR> tag??<BR><BR>Any help would be appreciated - <BR><BR>Carl

  2. #2
    Join Date
    Dec 1969
    Posts
    552

    Default RE: Format Text field from SQL DB

    Yes, use the Replace function.<BR><BR>Dim MemoFieldString<BR>MemoFieldString = Replace(RS("MemoField"), chr(10), "<BR>")<BR><BR>(I think it&#039s chr(10), it might be chr(13), or just try vbCrLf)<BR><BR>Let me know if that works.

  3. #3
    Join Date
    Dec 1969
    Posts
    52

    Default RE: Format Text field from SQL DB

    Thank You Thank You!!<BR><BR>It worked great - <BR><BR>Here is how I used the code - <BR><BR>&#060;p align="LEFT"> <BR>&#060;% Dim ChangeDescription <BR>ChangeDescription = Replace(recordSet.Fields("chgdesc"), chr(10), "<BR>")<BR>&#037;&#062;<BR>&#060;%=MemoFieldString &#037;&#062;<BR>&#060;/p>

Posting Permissions

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