G
Guest
I have a routine that does a standard comparison that I pass two objects to
Private Function ColumnEqual(ByVal A As Object, ByVal B As Object) As Boolea
' Compares two values to determine if they are equal. Also compares DBNULL.Value
If A Is DBNull.Value And B Is DBNull.Value Then Return True ' Both are DBNull.Value
If A Is DBNull.Value Or B Is DBNull.Value Then Return False ' Only one is DBNull.Value
Return A = B ' Value type standard compariso
'Return A Is
End Functio
If option strict is off and A = "AAA" and B = "AAA"
Return A = B ' Value type standard compariso
returns Tru
with option strict o
Return A Is
returns false
Why doesn't Return A Is B return true if the values are the same
I would like to leave option strict on......
Private Function ColumnEqual(ByVal A As Object, ByVal B As Object) As Boolea
' Compares two values to determine if they are equal. Also compares DBNULL.Value
If A Is DBNull.Value And B Is DBNull.Value Then Return True ' Both are DBNull.Value
If A Is DBNull.Value Or B Is DBNull.Value Then Return False ' Only one is DBNull.Value
Return A = B ' Value type standard compariso
'Return A Is
End Functio
If option strict is off and A = "AAA" and B = "AAA"
Return A = B ' Value type standard compariso
returns Tru
with option strict o
Return A Is
returns false
Why doesn't Return A Is B return true if the values are the same
I would like to leave option strict on......