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

L

Les Juby

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 (e-mail address 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....?
 
B

Bob Barrows

Les said:
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
 
A

Aaron Bertrand - MVP

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)%>">
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top