Variable from RecordSet only keeps the first word.? Huh.?

Discussion in 'ASP General' started by Les Juby, Aug 29, 2003.

  1. Les Juby

    Les Juby Guest

    Tearing heair out here ........... and there must be a simple
    solution.

    The words Joe Peter Smith are stored in an Access-97 field called
    Contact and are returned in a record set and stored to a variable
    called ShowContact

    ie. ShowContact = rstemp("Contact")

    But when the variable ShowContact is displayed.

    ie. <% =ShowContact %>

    it conatins only Joe and not Joe Peter Smith

    Any suggestions please.

    TIA

    .les.

    o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
    Les Juby
    Webpro Internet - - - Prosoft Microsystems
    Durban, KwaZulu-Natal, South Africa
    P.O.Box 35243, Northway 4065, South Africa
    Tel: +27 31 563-8344 Fax: +27 31 564-4928
    o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
    (you *do* know to take "anti-spam" out the address....?
     
    Les Juby, Aug 29, 2003
    #1
    1. Advertising

  2. Les Juby

    Bob Barrows Guest

    Les Juby wrote:
    > Tearing heair out here ........... and there must be a simple
    > solution.
    >
    > The words Joe Peter Smith are stored in an Access-97 field called
    > Contact and are returned in a record set and stored to a variable
    > called ShowContact
    >
    > ie. ShowContact = rstemp("Contact")
    >
    > But when the variable ShowContact is displayed.
    >
    > ie. <% =ShowContact %>
    >
    > it conatins only Joe and not Joe Peter Smith
    >

    I've never seen this behavior: are you sure there are not quotes or other
    characters in that Contact field? Is Contact a Text or Memo field?

    I just tried it: I can't reproduce this problem: there is something you are
    inadvertantly leaving out of your description of the problem. In the
    meantime, try using Replace to replace the spaces with &nbsp;

    ShowContact = Replace(ShowContact, " ","&nbsp;")

    Depending on where in the document you are writing this to, this may yield
    unwanted results.

    HTH,
    Bob Barrows
     
    Bob Barrows, Aug 29, 2003
    #2
    1. Advertising

  3. > But when the variable ShowContact is displayed.
    >
    > ie. <% =ShowContact %>
    >
    > it conatins only Joe and not Joe Peter Smith


    Sounds like this is in an input field, yes? And you have something like
    this:

    <input type=text name=contact value=<%=showContact%>>

    Well, as any HTML manual will tell you, text values are supposed to be
    enclosed in quotes, so try:

    <input type="text" name="contact" value="<%=showContact%>">

    Probably even safer to use:

    <input type="text" name="contact"
    value="<%=Server.HTMLEncode(showContact)%>">
     
    Aaron Bertrand - MVP, Aug 29, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Owen

    Output parameters undefined? Huh?

    Jim Owen, Oct 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    425
    Rajesh.V
    Oct 22, 2003
  2. Replies:
    4
    Views:
    433
    Richard Herring
    Oct 4, 2005
  3. Lawrence D'Oliveiro
    Replies:
    9
    Views:
    627
    Stefan Behnel
    Nov 12, 2010
  4. Hung Huynh
    Replies:
    8
    Views:
    329
    Bob Barrows
    Sep 24, 2003
  5. Sagar
    Replies:
    0
    Views:
    93
    Sagar
    Jan 18, 2006
Loading...

Share This Page