Runs the query, fills the result set with data, and returns the record count (the number of rows) of the result set.
TheExecuteAndCountRecords method provides the combined functionality of the EnableRecordCount, Execute, and GetRecordCount methods.
When this method returns, the cursor is positioned before the first record. You must call the MoveNext method before retrieving the first record's values. To retrieve values from a record, use the GetColumnValue method.
You can limit the result set by using the MaxResultSetRows method.
VBScript
' You can use this one line: rows = resultset.ExecuteAndCountRecords ' rather than these three lines: ResultSet.EnableRecordCount ResultSet.Execute rows = ResultSet.RecordCount
Perl
# You can use this one line: $rows = $resultset->ExecuteAndCountRecords(); # rather than these three lines: $resultset->EnableRecordCount(); $resultset->Execute(); $rows = $resultset->GetRecordCount();