Display first 3 lines of text from database field, vbscript asp

I would like to pulll in the first three lines of a text field I call "teaser" that resides in a SQL database via VBscript and ASP.   There are only about 15 records.  Any ideas would be greatly appreciated.  Many thanks in advance.
meldraperAsked:
Who is Participating?
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
say you have a text field in the database called "teaser" and you access its contents like so:

dim teaser : teaser = rs("teaser")

this loads the contents into a variable called teaser. What you could do is only display x amount of characters (can't do "lines" as amount of text in 3 lines could change based off of screen format). To do this, you could do:

dim teaser : teaser = rs("teaser")
if teaser <> "" then
    numOfCharsToDisplay = 100
    teaser = Left( teaser, numOfCharsToDisplay )
end if

where numOfCharsToDisplay is the number of characters to display
0
 
meldraperAuthor Commented:
PERFECTO.  Exactly what I was looking for.  Many thanks.
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
glad to have helped
0
 
meldraperAuthor Commented:
Worked perfectly. Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.