ExecuteAndCountRecords

Description

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.

Note: This method became available in version 7.1.

Syntax

VBScript


resultset.ExecuteAndCountRecords 

Perl


$resultset->ExecuteAndCountRecords(); 
Identifier
Description
resultset
A ResultSet object, representing the rows and columns of data resulting from a query.
Return value
A Long containing the number of records in the result set.

Example

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();