|
-
Jun 29th, 2000, 12:41 AM
#4
I beleieve the rules for DAO recordsets are as follows:
If you open the recordset as table, as in:
set rs = db.OpenRecordset("Table1", dbOpenTable)
Then rs.RecordCount will return the actual number of records in the table.
But -- if you open the recordset as a dynaset or snapshot, as in:
set rs = db.OpenRecordset("Select * From Table1", dbOpenDynaset)
Then rs.RecordCount will return the number of records visited! (And when you first open a dynaset, only one record has been visited, so RecordCount will always be 1.) So as the others mentioned, you must do a MoveLast to force Jet to "look at" or "visit" all the records and return an accurate Recordcount.
P.S. - If you omit "dbOpenTable" or "dbOpenDynaset", Jet will make certain assumptions: If you give a table name, it will assume "dbOpenTable"; if you give a SQL statement, it will assume "dbOpenDynaset".
"It's cold gin time again ..."
Check out my website here.
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
|