-
Recordset in ADC
Hi ,
I want to loop thru my whole "empoyees" table:
rs.Open "employees", , , cmdTable
rs.MoveFirst
Do while not rs.EOF
...
rs.MoveNext
The problem is if my table happens to be empty, right after the statement : rs.Movefirst, the program bumps. How can I control this ?
Thanks
-
Re: Recordset in ADC
rs.Open "employees", , , cmdTable
If Not rs.EOF And Not rs.BOF Then
rs.MoveFirst
Do while not rs.EOF
...
rs.MoveNext
Loop
End If
If you have at least one record, both EOF and BOF cannot be true, at the same time...
-
Re: Recordset in ADO
Hi Rufus,
I really appreciate your reply.
Thx
-
Re: Recordset in ADC
Hello Friend,
After you open the recordset, check whether the rs.recordcount >0.
i.e.
If rs.recordcount>0 then
rs.movefirst
..............
.......
endif
Don't Worry! Be Happy!!