Professional Web Applications Themes

Having Problems Returning Data from Sql to a Web Form - Microsoft SQL / MS SQL Server

I am running Sql Server 2000 and have an ASP page that queries some of the tables from Sql and returns their values to text boxes or text areas in a web form. This all seems to be working fine except for one case, if there is a carriage return/line feed stored in the field in the table. When that happens, nothing is returned to the text box or area. I had this same sort of problem with single and double quotes, but got around that by adding a function to duplicate any single or double quotes so that they ...

  1. #1

    Default Having Problems Returning Data from Sql to a Web Form

    I am running Sql Server 2000 and have an ASP page that queries some of
    the tables from Sql and returns their values to text boxes or text
    areas in a web form. This all seems to be working fine except for one
    case, if there is a carriage return/line feed stored in the field in
    the table. When that happens, nothing is returned to the text box or
    area.

    I had this same sort of problem with single and double quotes, but got
    around that by adding a function to duplicate any single or double
    quotes so that they would submit and retrieve ok. Any ideas on the
    carriage return/line feed problem?

    Thanks,
    Kerry
    Kerry Guest

  2. #2

    Default Re: Having Problems Returning Data from Sql to a Web Form

    Kerry,

    Have you looked at the final source of your ASP code page? You might
    find the carriage return in the source HTML outside of your text box.

    Do you know the ASCII value of the carriage return? You may be able to
    do REPLACE(fieldName,CHAR(10)+char(13),'') in your SQL string to clean
    up your data.

    i.e.,
    select replace((select 'asdf' + char(13) + char(10)+
    'asdfas'),char(13)+char(10),'')

    Line feed - char(10)
    Carriage return - char(13)

    Hope this helps.

    Robert


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Robert Guest

Similar Threads

  1. Returning form data for list of radio buttons
    By richard.wong in forum Macromedia ColdFusion
    Replies: 5
    Last Post: June 2nd, 02:51 PM
  2. IPN not returning any form feilds
    By neilorourker in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: May 13th, 08:35 AM
  3. Returning to a form
    By Stewart in forum ASP
    Replies: 1
    Last Post: October 8th, 03:31 AM
  4. Problems retrieving data from form
    By Doug Partridge in forum ASP
    Replies: 2
    Last Post: September 5th, 05:43 AM
  5. Problems with unbound form used to add data
    By Steve Springer in forum Microsoft Access
    Replies: 1
    Last Post: July 7th, 09:41 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139