|
-
August 7th, 1999, 04:00 PM
#1
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
-
August 8th, 1999, 12:36 PM
#2
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...
-
August 8th, 1999, 01:28 PM
#3
Re: Recordset in ADO
Hi Rufus,
I really appreciate your reply.
Thx
-
September 8th, 1999, 01:08 PM
#4
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!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|