Professional Web Applications Themes

String truncated at the first space in the string - ASP Database

Hi, A curious thing append here! The line #1 create a TableData (table cell), a textbox and assign the current Field Value to the texBtox value (Value=Field.Value) The line #2 create a TableData (table cell) and assing the field value to the Table cell. The line #3 was taken fron the view source for the concerned ASP page. As you can see the text is "Very good chocolat" in both case. But in line #1 I get only the word "Very" it's the same for every record. It's always truncated at the first 'space character' (chr(32)). Note: The String come ...

  1. #1

    Default String truncated at the first space in the string

    Hi,

    A curious thing append here!

    The line #1 create a TableData (table cell), a textbox and assign the
    current Field Value to the texBtox value (Value=Field.Value)

    The line #2 create a TableData (table cell) and assing the field value
    to the Table cell.

    The line #3 was taken fron the view source for the concerned ASP page.
    As you can see the text is "Very good chocolat" in both case. But in
    line #1 I get only the word "Very" it's the same for every record. It's
    always truncated at the first 'space character' (chr(32)).

    Note: The String come from a standard text field from an Access 2000 db.
    The length in 50 charracters.

    1- Tmp = Tmp & "<TD BGCOLOR=" & sRowColor + " valign='Top'>" & _
    "<INPUT TYPE=Text NAME='Comment' SIZE=50 VALUE ="
    & _
    F.Value & "></TD>"
    2- Tmp = Tmp & "<TD BGCOLOR=" & sRowColor + " valign='Top'>" & _
    F.Value & "&nbsp;</TD>"


    3- <INPUT TYPE=Text NAME='Comment' SIZE=50 VALUE =Very good
    chocolat&nbsp></TD><TD BGCOLOR=#FFFFFF valign='Top'>Very good
    chocolat&nbsp;</TD></TR>

    Any idea will be appreciate
    thank's
    serge

    Serge Myrand Guest

  2. #2

    Default Re: String truncated at the first space in the string

    Thank you very much,

    Do you know an equivalent in VBScript to the Delphi QuotedStr() method?

    serge


    "Ray at <%=sLocation%> [MVP]" wrote:
    > You have to enclose the value in quotes for the browser to know that the
    > value continues beyond the space.
    >
    > <input type="text" value="Very good chocolat">
    > vs.
    > <input type=text value=Very good chocolat>
    >
    > The browser will thing that "good" and "chocolat" are just some unrecognized
    > attributes and ignore the words.
    >
    > Ray at home
    >
    > "Serge Myrand" <infosoftdelirium.qc.ca> wrote in message
    > news:40E98CB9.46E3B380softdelirium.qc.ca...
    >
    > >
    > > 3- <INPUT TYPE=Text NAME='Comment' SIZE=50 VALUE =Very good
    > > chocolat&nbsp></TD><TD BGCOLOR=#FFFFFF valign='Top'>Very good
    > > chocolat&nbsp;</TD></TR>
    > >
    Serge Myrand Guest

  3. #3

    Default Re: String truncated at the first space in the string

    You have to enclose the value in quotes for the browser to know that the
    value continues beyond the space.

    <input type="text" value="Very good chocolat">
    vs.
    <input type=text value=Very good chocolat>

    The browser will thing that "good" and "chocolat" are just some unrecognized
    attributes and ignore the words.

    Ray at home


    "Serge Myrand" <infosoftdelirium.qc.ca> wrote in message
    news:40E98CB9.46E3B380softdelirium.qc.ca...
    >
    > 3- <INPUT TYPE=Text NAME='Comment' SIZE=50 VALUE =Very good
    > chocolat&nbsp></TD><TD BGCOLOR=#FFFFFF valign='Top'>Very good
    > chocolat&nbsp;</TD></TR>
    >

    Ray at Guest

  4. #4

    Default Re: String truncated at the first space in the string

    That wouldn't help you hear anyway. For one, you don't have to deal with '
    if you use " as your delimiter in your HTML. (Recommended) Also, in HTML,
    you cannot "escape" characters by doubling them up. You have to replace "
    with &quot;. Server.HTMLEncode will do that for you. Try this:

    <%
    sValue = "Joe's cat walked up to Mary O'Brien's dog and said, ""Meow!"""
    %>

    <input type="text" value="<%=Server.HTMLEncode(sValue)%>">

    Ray at home



    "Serge Myrand" <infosoftdelirium.qc.ca> wrote in message
    news:40E98FE5.26871305softdelirium.qc.ca...
    > Thank you very much,
    >
    > Do you know an equivalent in VBScript to the Delphi QuotedStr() method?
    >
    > serge
    >
    >
    > "Ray at <%=sLocation%> [MVP]" wrote:
    >
    > > You have to enclose the value in quotes for the browser to know that the
    > > value continues beyond the space.
    > >
    > > <input type="text" value="Very good chocolat">
    > > vs.
    > > <input type=text value=Very good chocolat>
    > >
    > > The browser will thing that "good" and "chocolat" are just some
    unrecognized
    > > attributes and ignore the words.
    > >
    > > Ray at home
    > >
    > > "Serge Myrand" <infosoftdelirium.qc.ca> wrote in message
    > > news:40E98CB9.46E3B380softdelirium.qc.ca...
    > >
    > > >
    > > > 3- <INPUT TYPE=Text NAME='Comment' SIZE=50 VALUE =Very good
    > > > chocolat&nbsp></TD><TD BGCOLOR=#FFFFFF valign='Top'>Very good
    > > > chocolat&nbsp;</TD></TR>
    > > >
    >

    Ray at Guest

  5. #5

    Default Re: String truncated at the first space in the string

    p.s. I know the difference between "hear" and "here." <blush!> :]

    Ray at home

    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:%238PqF%23rYEHA.556tk2msftngp13.phx.gbl...
    > That wouldn't help you hear anyway. For one, you don't have to deal with
    '


    Ray at Guest

  6. #6

    Default Re: String truncated at the first space in the string

    Thank's I will get a look.
    serge

    "Ray at <%=sLocation%> [MVP]" wrote:
    > That wouldn't help you hear anyway. For one, you don't have to deal with '
    > if you use " as your delimiter in your HTML. (Recommended) Also, in HTML,
    > you cannot "escape" characters by doubling them up. You have to replace "
    > with &quot;. Server.HTMLEncode will do that for you. Try this:
    >
    > <%
    > sValue = "Joe's cat walked up to Mary O'Brien's dog and said, ""Meow!"""
    > %>
    >
    > <input type="text" value="<%=Server.HTMLEncode(sValue)%>">
    >
    > Ray at home
    >
    > "Serge Myrand" <infosoftdelirium.qc.ca> wrote in message
    > news:40E98FE5.26871305softdelirium.qc.ca...
    > > Thank you very much,
    > >
    > > Do you know an equivalent in VBScript to the Delphi QuotedStr() method?
    > >
    > > serge
    > >
    > >
    > > "Ray at <%=sLocation%> [MVP]" wrote:
    > >
    > > > You have to enclose the value in quotes for the browser to know that the
    > > > value continues beyond the space.
    > > >
    > > > <input type="text" value="Very good chocolat">
    > > > vs.
    > > > <input type=text value=Very good chocolat>
    > > >
    > > > The browser will thing that "good" and "chocolat" are just some
    > unrecognized
    > > > attributes and ignore the words.
    > > >
    > > > Ray at home
    > > >
    > > > "Serge Myrand" <infosoftdelirium.qc.ca> wrote in message
    > > > news:40E98CB9.46E3B380softdelirium.qc.ca...
    > > >
    > > > >
    > > > > 3- <INPUT TYPE=Text NAME='Comment' SIZE=50 VALUE =Very good
    > > > > chocolat&nbsp></TD><TD BGCOLOR=#FFFFFF valign='Top'>Very good
    > > > > chocolat&nbsp;</TD></TR>
    > > > >
    > >
    Serge Myrand Guest

Similar Threads

  1. String or binary data would be truncated error
    By Ivan Demkovitch in forum ASP
    Replies: 3
    Last Post: September 18th, 10:39 PM
  2. #24777 [NEW]: $_GET values truncated at %3C in query string
    By csnyder at chxo dot com in forum PHP Development
    Replies: 0
    Last Post: July 23rd, 08:59 PM
  3. Replies: 0
    Last Post: July 21st, 08:44 AM
  4. error: String or binary data would be truncated.
    By Scott A. Keen in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 11th, 04:40 PM
  5. Replies: 0
    Last Post: July 10th, 03:58 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