PC Review


Reply
Thread Tools Rate Thread

Counting number of records returned by SQL.

 
 
Mike O'Brien
Guest
Posts: n/a
 
      5th Sep 2003
Try using the RecordCount property of your recordset after
the MoveLast method:

>strSQL = "Select values from table"
>set db = DBEngine.Workspaces(0).Databases(0)
>set rs = db.OpenRecordset(strSQL, DB_OPEN_DYNASET)

rs.MoveLast
Debug.Print rs.RecordCount

Mike.

>-----Original Message-----
>I am using code similar to the below to return a number

of
>rows from a table.
>
>strSQL = "Select values from table"
>set db = DBEngine.Workspaces(0).Databases(0)
>set rs = db.OpenRecordset(strSQL, DB_OPEN_DYNASET)
>
>Is there a way to find the number of rows returned

without
>having to do a "Select count(values)...." statement.
>
>Many thanks
>Ian Norris
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare number of records read vs number returned access Greg Microsoft Access Reports 5 18th Feb 2009 03:03 PM
Counting detail records returned in a query David Kistner Microsoft Access Getting Started 4 25th Sep 2004 11:25 PM
Counting records returned on subform Silvester Microsoft Access Form Coding 2 27th Jun 2004 11:20 PM
Counting records returned on subform Silvester Microsoft Access 2 27th Jun 2004 11:20 PM
Re: Counting number of records returned by SQL. Tim Ferguson Microsoft Access VBA Modules 0 5th Sep 2003 07:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:13 PM.