Recordset value starting with "<" (less than sign) wont display

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J.D. Buehls

    Recordset value starting with "<" (less than sign) wont display

    I am displaying some values on a report. I am opening the .asp page
    with a
    Response.Conten tType = "applicatio n/msword" and these particular
    values appear in a table. One column shows percentages such as "5",
    "95", "50", or "<5" There is no "%" character stored in the database
    just the number (and the "<" sign if there is one).

    Problem is NONE of the "<5" values appear in my report table. Does
    this have something to do with "<" being an html character. The field
    type is just a size 3 nvarchar. Relevant code below:

    strSQL2 = "SELECT * FROM jambue.SUMMARY WHERE POSCODE = '" & id & "'
    AND IDCODE1 ='" & dept & "' AND IDCODE2 ='" & unit & "'"
    Set rstDBEdit2 = Server.CreateOb ject("ADODB.Rec ordset")
    rstDBEdit2.Open strSQL2, CONN_STRING, adOpenKeyset, adLockOptimisti c,
    adCmdText

    <font face="Courier New" size="-1"><%=
    rstDBEdit2.Fiel ds("H_STAP").Va lue %> %</font>
  • Manohar Kamath [MVP]

    #2
    Re: Recordset value starting with &quot;&lt;&quot ; (less than sign) wont display

    Use Server.HTMLEnco de() if you want to display all symbols on the screen,
    rather than use the exact text in your HTML. Otherwise, symbols like < will
    get mixed with the other HTML content on your page and ahcnage the display.

    E.g.

    <%= Server.HTMLEnco de(rstDBEdit2.F ields("H_STAP") .Value) %>

    The HTMLEncode method replaces certain symbols with the HTML equivalents. <
    will be represented by &lt;

    --
    Manohar Kamath
    Editor, .netWire



    "J.D. Buehls" <bulldawgfan120 00@yahoo.com> wrote in message
    news:733c346f.0 406160638.55527 5eb@posting.goo gle.com...[color=blue]
    > I am displaying some values on a report. I am opening the .asp page
    > with a
    > Response.Conten tType = "applicatio n/msword" and these particular
    > values appear in a table. One column shows percentages such as "5",
    > "95", "50", or "<5" There is no "%" character stored in the database
    > just the number (and the "<" sign if there is one).
    >
    > Problem is NONE of the "<5" values appear in my report table. Does
    > this have something to do with "<" being an html character. The field
    > type is just a size 3 nvarchar. Relevant code below:
    >
    > strSQL2 = "SELECT * FROM jambue.SUMMARY WHERE POSCODE = '" & id & "'
    > AND IDCODE1 ='" & dept & "' AND IDCODE2 ='" & unit & "'"
    > Set rstDBEdit2 = Server.CreateOb ject("ADODB.Rec ordset")
    > rstDBEdit2.Open strSQL2, CONN_STRING, adOpenKeyset, adLockOptimisti c,
    > adCmdText
    >
    > <font face="Courier New" size="-1"><%=
    > rstDBEdit2.Fiel ds("H_STAP").Va lue %> %</font>[/color]


    Comment

    • J.D. Buehls

      #3
      Re: Recordset value starting with &quot;&lt;&quot ; (less than sign) wont display

      Thanks for the reply!

      I tried using the HTMLEncode method before making my first post. I had
      thought about that having used the method before. However when I use
      that on all my fields I still just get a blank. I checked uner VIEW -
      HTML SOURCE inside WORD and this is in the spot where my recordset value
      should be:

      <td style='padding: 0in 0in 0in 0in'>
      <p class=MsoNormal align=center style='text-align:center'>
      <![if !supportEmptyPa ras]>&nbsp;<![endif]>
      <span style='font-size:10.0pt'><o :p></o:p></span></p>
      </td>
      <5 %>


      This is what is looks like for another percentage (100%)

      <td style='padding: 0in 0in 0in 0in'>
      <p class=MsoNormal align=center style='text-align:center'>< span
      style='font-size:7.5pt;font-family:"Courier New"'>100 %</span><span
      style='font-size:10.0pt'><o :p></o:p></span></p>
      </td>


      So it is getting screwed up somehow.

      *** Sent via Devdex http://www.devdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      Working...