Record Count

Results 1 to 2 of 2

Thread: Record Count

  1. #1
    Join Date
    Dec 1969
    Posts
    23

    Default Record Count

    I am trying to count the number of records in a recordset. <BR>RS.RecordCount gives a value of 0 or -1 depending on when records are found or not. How do I get the number of records in the recordset?

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Record Count

    This is because you need to open your recordset with the proper cursor. The cursor determines if you can navigate through your recordset in a forward and backward motion or not. Using the default cursor (i.e. not specifying a cursor) opens a ForwardOnly cursor. The .RecordCount property determines the # of records by moving to the end of the recordset, then back to the beginning, so you need a recordset that supports movement in both ways.<BR><BR>See:<BR> Recordset Cursors: Choose the Right Cursor for the Right Job<BR> http://www.4guysfromrolla.com/webtech/112998-1.shtml<BR><BR>for more information on choosing a recordset cursor. For a more technical discussion of cursors and their associated performances, be sure to read:<BR><BR> Cursor & LockType Performance Issues<BR> http://www.4guysfromrolla.com/webtech/062799-3.shtml<BR><BR>Have a great day!<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •