That is the question…
I am working on an old Visual Basic project. It is not my own, it’s just an existing project in which I have to make some changes. There’s an existing database connection and in one of “my” functions, I have run a query, and created a recordset (rs). In a loop, I am iterating through the records with a bit of code like this:
If Not IsNull(rs!X) Then
strX = rs!X
Else
strX = ""
End If
or, if you like
strX = IIf(IsNull(rs!X), "", rs!X)
Somehow, I get an error, “Invalid use of Null”, on the second line! So, rs!X is Null on the second line, but it wasn’t on the first line, or else the code would never have come to the second line! How is this possible?!?
Posted by benjaminvrolijk
Posted by benjaminvrolijk