I'm working on QTP 8.0 and I tried to do some sql queries in QTP. But while I'm using "RecordCount" function it returns the value as -1 only , if there are records in the table also. Please find query I used and if anyone can solve this it will be very much helpful for me.
Set obj = CreateObject "ADODB.Connection"
Set rec= obj.Execute "select * from Orders where
Order_Number <= 10"
MsgBox rec "Customer_Name".Value
While Not rec.EOF
MsgBox rec 1.Value
Note : I had tried this by using MoveLast before the RecordCount statement also. I'had put the paranthesis wherever it is required, while posting in this mail it shows some html error so I removed it from here.