[thelist] trimming db output (was: ASP question: Req...)

MRC webmaster at equilon-mrc.com
Thu Nov 29 13:36:46 CST 2001


matt and Anthony,

> >varFieldOne = Trim(objRS("FieldOne"))
> >
> >You save yourself from debugging hell when the data does not come out
> >"clean" from the DB.
>
> Be careful with this if your field can be NULL.

    SQL Server bench-warmer here, with a tip for avoiding the problem that
matt mentions while incorporating Anthony's suggestion:

varFieldOne = Trim(objRS("FieldOne") & "")

    This, of course, forces at least an empty string and avoids any
headaches from nulls. Comments? Counter-suggestions?

James Aylard





More information about the thelist mailing list