ADO 탐색 방법


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

Seek 메서드는 Recordset의 인덱스를 검색하여 keyvalues ​​매개 변수에 지정된 값과 일치하는 레코드를 찾습니다. 일치하는 항목이 있으면 포인터는 seekoption 매개변수에 의해 지정된 레코드를 가리킵니다. 일치하는 항목이 없으면 레코드 포인터가 Recordset의 끝에 배치됩니다.

참고: 이 방법을 사용하려면 공급자가 이 방법과 Recordset(Index 속성)의 인덱스 사용을 지원해야 합니다. 공급자가 검색 및 인덱스를 지원하는지 여부를 확인하려면 Supports 메서드를 사용합니다.

참고: 이 방법을 실행하기 전에 Index 속성을 원하는 인덱스로 설정하십시오.

참고: 이 방법은 서버측 커서에만 사용할 수 있습니다(CursorLocation 속성 값이 adUseClient인 경우 지원되지 않음).

참고: 이 메서드는 Recordset 개체가 adCmdTableDirect의 CommandTypeEnum 값으로 열린 경우에만 사용할 수 있습니다.

통사론

recordsetobj.Seek keyvalues,seekoption

Parameter Description
keyvalues Required. An array of values to compare with the values in each column 
seekoption Required. A SeekEnum value that specifies the type of seek

SeekEnum 값

Constant Value Description
adSeekFirstEQ 1 Seeks the first key equal to keyvalues
adSeekLastEQ 2 Seeks the last key equal to keyvalues
adSeekAfterEQ 4 Seeks either a key equal to keyvalues or just after where that match would have occurred
adSeekAfter 8 Seeks a key just after where a match with keyvalues would have occurred
adSeekBeforeEQ 16 Seeks either a key equal to keyvalues or just before where that match would have occurred
adSeekBefore 32 Seeks a key just before where a match with keyvalues would have occurred

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