Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Counts of ADO recordset 2

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US
Trying to get the number of records in an ADO recordset, using the following code:

If mailRs.Supports(adApproxPosition) = True Then
Me.EmCount.Value = mailRs.RecordCount
End If

It skips the second line of code indicating that my RS does not support the cursor type. How do you set that support, or is there another way of skinning the cat (getting a record count).

Office 10
Windows 7

Thanks

jpl
 
hi,

Code:
with mailRs
   on error resume next

   .movefirst

   if err.number = 0 then
      Me.EmCount.Value = .recordcount

      do while not .eof
       'do stuff with data for current row

         .movenext
      loop
   end if
end with

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top