Re: recordset fragility
From: Chris Hohmann (nospam_at_thankyou.com)
Date: 03/30/04
- Next message: Dean J. Garrett: "Re: Script Engine Exception?"
- Previous message: Aaron Bertrand [MVP]: "Re: recordset fragility"
- In reply to: Aaron Bertrand [MVP]: "Re: recordset fragility"
- Next in thread: HenryW: "Re: recordset fragility"
- Reply: HenryW: "Re: recordset fragility"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 30 Mar 2004 10:50:07 -0800
"Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
news:%23PLUqNoFEHA.3912@TK2MSFTNGP10.phx.gbl...
> You should read up on treating TEXT/MEMO columns from ASP. One
suggestion
> is to store the value in a variable IMMEDIATELY after opening the
recordset,
> and refer to the variable within the loop as opposed to the recordset
> object.
>
> http://www.aspfaq.com/2188
>
> As for wrapping the lines, I'm still not sure why your text is forcing
your
> table widths to extend beyond the width of the browser. As I asked
before,
> can you show a URL where this is happening? This sounds like an HTML
> problem, and not one that should be solved by ASP or using a <style>
tag
> (note that some browsers won't obey <style> at all, and others might
obey it
> differently). Also not sure why you're putting each line into its own
cell,
> or why you think your local variable "co_desc_temp" is magically put
into
> your recordset collection?
>
> In any case, here is a way to ensure your line lengths are 60
characters at
> most. It will break at the last space of each line before it hits 60
chars.
>
> <%
> if not objRS.eof then
> txt = objRS("co_desc")
> do while len(txt) > 60
> tmp = left(txt, 60)
> ls = instrRev(tmp, " ")
> tmp = left(tmp, ls)
> txt = right(txt, len(txt)-ls)
> output = output & "<br>" & tmp
> loop
> response.write output & "<br>" & txt
> end if
> %>
>
> The only potential problem I foresee is if you have a chunk of > 60
> characters without a space.
Here's a regular expression solution that takes into account long
strings without spaces.
http://groups.google.com/groups?threadm=eNyFXD3nDHA.2512%40TK2MSFTNGP09.phx.gbl
- Next message: Dean J. Garrett: "Re: Script Engine Exception?"
- Previous message: Aaron Bertrand [MVP]: "Re: recordset fragility"
- In reply to: Aaron Bertrand [MVP]: "Re: recordset fragility"
- Next in thread: HenryW: "Re: recordset fragility"
- Reply: HenryW: "Re: recordset fragility"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|