Null and IIS6

Results 1 to 2 of 2

Thread: Null and IIS6

  1. #1
    Join Date
    Dec 1969

    Default Null and IIS6

    Is Null evaluated differently on IIS6?<BR><BR>For examples, I am checking a value in a database as follows:<BR><BR>[code language="vbscript"]<BR>If objRS("SomeField") &#060;&#062; "X" Then<BR> &#039; Do Something<BR>End If<BR>[/code]<BR><BR>If the value of objRS("SomeField") is a null value, that is, not equal to "X", then the above statement should evaluate to True. However, I now, on IIS6 need to use the following statement to make this True.<BR><BR>[code language="vbscript"]<BR>If objRS("SomeField") &#060;&#062; "X" or IsNull(objRS("SomeField")) Then<BR> &#039; Do Something<BR>End If<BR>[/code]<BR><BR>Am I correct in my assumption?

  2. #2
    Join Date
    Dec 1969

    Default No clue, but..

    What I always do is implicitly convert NULL to a zero-length string (""):<BR>[code language="VBScript"]<BR>If objRs("SomeField") & "" &#060;&#062; "X" Then<BR> ...<BR>End If<BR>[/code]<BR>In fact, I&#039;m spastic enough to ALWAYS Trim() my values, too:<BR>[code language="VBScript"]<BR>If Trim(objRs("SomeField") & "") &#060;&#062; "X" Then<BR> ...<BR>End If<BR>[/code]<BR>As for your exact question, did something change between IIS5 and IIS6, I don&#039;t know. Things like that don&#039;t usually change, but you never know.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts