Results 1 to 6 of 6

Thread: RECORD COUNT WITH ACCES 97

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    33

    Post

    HOW CAN I COUNT THE ROCORS OF MY DATABASE????

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    If you are using recordsets, use the .RecordCount property.

    Only remember that it will return 0 if there are no records in the recordset, and 1 otherwise.

    This is because the .RecordCount property returns the number of records processed, not retrieved. So you can check for existance of records in the recordset by checking if the .RecordCount property is non-zero.



    And if you want to do it through SQL, use "Select Count(*) From ...."



    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3
    Addicted Member CoMMiE's Avatar
    Join Date
    Jul 2000
    Location
    Malaysia, Kuala Lumpur
    Posts
    179
    Hi Bjorn
    Try this

    Code:
    Data1.Recordset.MoveLast
    numrecs = Data1.Recordset.RecordCount
    Data1.Recordset.MoveFirst
    
    msgbox numrecs


  4. #4
    Guest

    Cool Use Max Property

    Originally posted by Bjorn
    HOW CAN I COUNT THE ROCORS OF MY DATABASE????
    Use the Max property with field
    ex:

    select max(bookid) from bookmaster

    This select statement will retrieve the Maximum number from the database...

  5. #5
    Junior Member
    Join Date
    Nov 2000
    Location
    Belgium
    Posts
    21

    Unhappy

    The function MAX will NOT return the number of record in the table, but the highest value of the indicated field. For instance : it is possible MAX(ID) returns 25142, even if there is only 1 record in the table.
    Best way is to use SQL "SELECT COUNT(*) FROM..."

  6. #6
    Guest

    Thumbs up right

    Originally posted by iring
    The function MAX will NOT return the number of record in the table, but the highest value of the indicated field. For instance : it is possible MAX(ID) returns 25142, even if there is only 1 record in the table.
    Best way is to use SQL "SELECT COUNT(*) FROM..."
    Yes U were right Iring
    Thanks !!!!


Posting Permissions

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



Click Here to Expand Forum to Full Width