ADO 찾기 방법


❮ 완전한 레코드세트 개체 참조

Find 메서드는 지정된 기준을 충족하는 레코드 집합에서 레코드를 검색합니다. 검색에 성공하면 레코드 포인터가 처음 발견된 레코드를 가리킵니다.

참고: 이 메서드를 호출하기 전에 현재 행 위치(예: MoveFirst)를 설정해야 합니다. 그렇지 않으면 오류가 발생합니다.

통사론

objRecordset.Find(criteria,skiprows,direction,start)

Parameter Description
criteria Required. The column name, comparison operator, and value to use in the search.

Examples:

"Country='Norway'"
"Date>#7/22/97#"
"Country LIKE N*"

Note: This method does not support multi-column searches (AND or OR)

skiprows Optional. Specifies how many records beyond the current record to skip before beginning the search. Default is 0 
direction Optional. A SearchDirectionEnum value that specifies the search direction
start Optional. The starting position for the search

SearchDirectionEnum 값

Constant Value Description
adSearchBackward -1 Searches backward from the starting position. Stops at the beginning of the Recordset. If no match, the record pointer is placed at the beginning of the Recordset
adSearchForward 1 Searches forward from the starting position. Stops at the end of the Recordset. If no match, the record pointer is placed at the end of the Recordset

❮ 완전한 레코드세트 개체 참조