JustinEzekiel proposed the correct solution: You shouldn't use the = sign to check if an object exists. In an If statement, you basically use the = as a comparison operator, but if the object doesn't exist, there is nothing to compare with...
A somewhat more structured way to put it, could be:
Select Case rstObjct Is Nothing
Case True
Case False
End Select
_________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]