Re: recordset fragility

From: Chris Hohmann (nospam_at_thankyou.com)
Date: 03/30/04


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



Relevant Pages

  • Re: Viewing the contents of two tables using ASP and MS Access
    ... Number of fields in a recordset 255 ... Number of characters in a cell in the query design grid 1,024 ... Number of characters in an SQL statement approximately 64,000 ...
    (microsoft.public.inetserver.asp.db)
  • Re: Query on text field with multiple spaces within the string
    ... > open a recordset containing just one record and one field - one that you ... > other invisible characters hidden in there. ... >>> you can find out for yourself by creating a SELECT query that returns ... >>> Please respond in the newgroup and not by email. ...
    (microsoft.public.access.queries)
  • Re: How to omit blank spaces in the text?
    ... Set adoPrimaryRS = New Recordset ... character set from &H21 to &H7E provides for ASCI alpha numeric characters ... When the password is first created you calculate the hash and store that, ... then it is almost certain the entered password is correct. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to omit blank spaces in the text?
    ... Set adoPrimaryRS = New Recordset ... you're best to read the characters one by one and ... When the password is first created you calculate the hash and store ... then it is almost certain the entered password is correct. ...
    (microsoft.public.vb.general.discussion)
  • Why does my recordset always return .eof=true?!
    ... I'm having an issue with a piece of code designed to populate a text ... Check if less than 3 characters entered and quit if so - not enough ... All appears to work until the recordset is opened. ... I've tried opening the query written with the above sql statement ...
    (comp.lang.basic.visual.misc)