Virgil Bierschwale wrote:
> Ok, I have empty fields in sql server and I need to replace them with &nbsp
> when they're null.
> 
> Apparently vbscript is a lot different then what I did in the past and I
> havent had much luck googling it.
> 
> How do ya'll trap for null in the code below ?
> 
> In the past I would have done it at before each response.write line, but the
> few samples I have found don't seem to work.
> 
> You can try out the code at http://www.virgilslist.com/branch.asp
> 
> Thanks
> 
> Virgil Bierschwale

qry = "SELECT " & fieldname3 & ", " & fieldname6 & ", " & fieldname5 & ", "
& fieldname7 & ", " & fieldname8 & ", " & fieldname9 & ", " & fieldname10 &
", " & fieldname11 & " FROM " & tablename & " where " & fieldname2 & " = '"
& svcBranch & "'"
Set oRS = oConn.Execute(qry)

<snipped>

I don't know if VB has a global setting (I doubt it) for handling nulls 
like VFP does i.e. SET NULL TO and SET NULLDISPLAY - but it might be 
worth looking for.

You can convert the nulls in your query code with the CASE statement:

Something like: CASE WHEN fieldname3 is null THEN '&nbsp' ELSE 
fieldname3 END

This is probably slower than doing something afterward as you write it 
out. Can't remember how VB supports (or not) the IIF construct.

Does this help?

Matthew S. Jarvis
IT Manager
Bike Friday - "Performance that Packs."
www.bikefriday.com
541/687-0487 x140
[EMAIL PROTECTED]


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to