|
|
 |
Re: FN-FORUM ASP code help
date posted 12th September 2002 17:17
It seems that what's happening here is that the value of strAffiliateID is
Null.
With the Len() function, if the string you're checking contains Null, then
Len() returns Null. So when you check
len( trim( strAffiliateID)) it returns Null, not 0.
To fix this change the If...Then statement to:
If (len( trim( strAffiliateID)) = 0) Or
(IsNull(len(trim(strAffiliateID)))) Then
Response.Write( "None")
Else
Response.Write( strAffiliateID & "hello")
End If
and you should get the result you're looking for.
Null means that the item contains no valid data - not the same as blank.
HTH
JohnO
---
John Olival
Explican Ltd. Internet Consultants
+44 (0)7980 834 217
http://www.explican.com
> strAffiliateID = RecordSet.Fields("fldAffiliateID")
> Response.Write( "*" & len( trim( strAffiliateID)) & "*")
> Response.Write( "*" & strAffiliateID & "*")
>
> If len( trim( strAffiliateID)) = 0 Then
> Response.Write( "None")
> Else
> Response.Write( strAffiliateID & "hello")
> End If
> %>
>
>
> Output:
>
> ****hello
|
 |
|