ExecuteAndCountRecords

설명

조회를 실행하고 결과 세트를 데이터로 채우며 결과 세트의 레코드 계수(행 수)를 리턴합니다.

TheExecuteAndCountRecords 메소드는 EnableRecordCount, Execute, GetRecordCount 메소드의 결합된 기능을 제공합니다.

이 메소드가 리턴되면 커서는 첫 번째 레코드 앞에 위치합니다. 첫 번째 레코드의 값을 검색하기 전에 MoveNext 메소드를 호출해야 합니다. 레코드에서 값을 검색하려면 GetColumnValue 메소드를 사용하십시오.

MaxResultSetRows 메소드를 사용하여 결과 세트를 제한할 수 있습니다.

주: 이 메소드는 버전 7.1부터 사용 가능합니다.

구문

VBScript

resultset.ExecuteAndCountRecords 

Perl

$resultset->ExecuteAndCountRecords(); 
ID
설명
resultset
조회 결과 데이터의 행과 열을 나타내는 ResultSet 오브젝트입니다.
Return value
결과 세트의 레코드 수가 포함된 Long을 리턴합니다.

예제

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

피드백