|
-
Dec 4th, 2000, 03:04 PM
#1
Thread Starter
Member
HOW CAN I COUNT THE ROCORS OF MY DATABASE????
-
Dec 4th, 2000, 04:12 PM
#2
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 ...."
-
Dec 5th, 2000, 12:07 AM
#3
Addicted Member
Hi Bjorn
Try this 
Code:
Data1.Recordset.MoveLast
numrecs = Data1.Recordset.RecordCount
Data1.Recordset.MoveFirst
msgbox numrecs
-
Dec 5th, 2000, 12:53 AM
#4
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...
-
Dec 5th, 2000, 01:38 AM
#5
Junior Member
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..."
-
Dec 5th, 2000, 01:43 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|