Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

limiting field size output from a database

Status
Not open for further replies.

scroce

MIS
Nov 30, 2000
780
US
I have a script which takes data out of a field in a database and plops it into my web page like so:

Do While not rsLinks.EOF

Response.Write &quot;<font color='#800000' size='2'>&quot; & &quot;<a>&quot; & rsLinks(&quot;LinkName&quot;) & &quot;</a>&quot; & &quot;<br>&quot; & &quot;</font>&quot;
rsLinks.MoveNext
Loop

But some of the info in the field is like 200 characters long.

What I would like to do is cut off what gets printed to the browser at 60 characters and append a litte &quot;...&quot; thingy at the end to indicate that there is more to the desciption.

Not sure how to do it. Anyone know how, or can point me to an example of something similar? How much more water would there be in the ocean if it weren't for sponges?
 
Use the Left() function
...

Do While not rsLinks.EOF
Response.Write &quot;<font color='#800000' size='2'>&quot; & &quot;<a>&quot; & Left(rsLinks(&quot;LinkName&quot;),60) & &quot;...</a>&quot; & &quot;<br>&quot; & &quot;</font>&quot;
rsLinks.MoveNext
Loop

-Ovatvvon :-Q
 
Wow! cool beans. Thanks Ovatvvon. That was easy. How much more water would there be in the ocean if it weren't for sponges?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top