Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
olay80
Yak Posting Veteran
62 Posts |
Posted - 2005-08-17 : 04:00:30
|
hey guys,i'm working some vb code and i need to know how to count the records in a recordset.thanx,Oliver |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-17 : 04:47:17
|
>>i'm working some vb code and i need to know how to count the records in a recordset.Set the cursor Location of the Recordset to aduseClientThen recordset.recordcount will show the record countMadhivananFailing to plan is Planning to fail |
 |
|
Kristen
Test
22859 Posts |
Posted - 2005-08-17 : 06:21:11
|
SELECT * FROM MyTableSELECT [RowCount] = @@ROWCOUNTwould do it - but you would have to process the first recordset to get to the second one which has the answer!A variation on that theme would be:SELECT [RowCount] = COUNT(*) FROM MyTable WHERE ...SELECT * FROM MyTable WHERE ...Kristen |
 |
|
|
|
|