Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Variable from RecordSet only keeps the first word.? Huh.?

Reply
Thread Tools

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

 
 
Les Juby
Guest
Posts: n/a
 
      08-29-2003
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 http://www.velocityreviews.com/forums/(E-Mail Removed)
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....?
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      08-29-2003
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


 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      08-29-2003
> 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)%>">


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generates integer literal of the largest value a variable can hold.Macro takes only variable-name. John Reye C Programming 14 05-08-2012 04:40 AM
asp code does not render for first record in looped recordset haft@canchair.com ASP General 18 07-25-2008 08:21 AM
Read a recordset into a variable so I can disconnect from DB and use results? Noozer ASP General 1 02-06-2006 10:19 PM
Datagrid paging keeps going back to the first group Kalvin ASP .Net Datagrid Control 2 04-19-2005 08:58 PM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM



Advertisments