If I have this SQL in QTP some times it won't return any values e.g.
SQL> SELECT Name,ID,Status
2 FROM MBRSHP_EARN_ACTV
3 WHERE MBRSHP_ID = 44546
4 and airln_resv_id is not null
no rows selected
I executed the above SQL in QTP
Set rec = obj.Execute(SQLquery)
and it may return results and it may not
Now I have any IF statement in QTP to check the results like If rec.Fields(2)<>"E" Then .....
this will fail
my question is how to check wether the SQL returned results or not?!
"I realize it's an error, but no one is going to try to do that!"
From "Top 10 Stupid Comments from Developers".