[thelist] ASP: First 100 words in a record

Ken Kogler ken.kogler at cph.org
Wed Jun 19 10:30:01 CDT 2002


hola, evolt amigos...

Using ASP, is there a way to limit the number of words returned in a
recordset?

Simple example: I've got a CMS that deals with articles. On the home page, I
want to show the first 100 words or so of every article with a "click here
to read the full text" link afterward.

Is there an easier way to do this (both on me and on the server) than to
string concatenation? I thought about just looking for the first </p> in the
field, but sometimes that can be only a few words into the article.

evolt.org does this on the homepage, but they're using a separate db field
for a descriptive paragraph (think they call it a synopsis). I could do it
this way, too, but it requires mods to the db, and that's not something the
client is prepared to let me do. I'm just supposed to pretty up the
front-end.

Thanks, folks.

-Ken




More information about the thelist mailing list