クエリーを実行し、結果セットにデータを入れてから、結果セットのレコード カウント (行数) を戻します。
ExecuteAndCountRecords メソッドが提供する機能は、EnableRecordCount、Execute、および GetRecordCount の各メソッドの機能を結合したものです。
このメソッドから戻されるとき、カーソルは先頭レコードの前に位置付けされます。先頭レコードの値を取得する前に、MoveNext メソッドを呼び出す必要があります。レコードから値を取得するには、GetColumnValue メソッドを使用します。
MaxResultSetRows メソッドを使用して、結果セットを制限できます。
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();