Seek Method

 

Description

 

Searches the index of a Recordset to quickly locate the row that matches the specified values, and changes the current row position to that row.

 

PowerBASIC Syntax

 

METHOD Seek ( _

  BYVAL KeyValues AS VARIANT, _

  OPTIONAL BYVAL SeekOption AS LONG _

)

 

Parameters

 

KeyValues

Optional. An array of Variant values. An index consists of one or more columns and the array contains a value to compare against each corresponding column.

SeekOption

A SeekEnum value that specifies the type of comparison to be made between the columns of the index and the corresponding KeyValues.

 

Remarks

 

Use the Seek method in conjunction with the Index property if the underlying provider supports indexes on the Recordset object. Use the Supports (adSeek) method to determine whether the underlying provider supports Seek, and the Supports (adIndex) method to determine whether the provider supports indexes. (For example, the OLE DB Provider for Microsoft Jet supports Seek and Index.)

 

If Seek does not find the desired row, no error occurs, and the row is positioned at the end of the Recordset. Set the Index property to the desired index before executing this method.

 

This method is supported only with server-side cursors. Seek is not supported when the Recordset object's CursorLocation property value is adUseClient.

 

This method can only be used when the Recordset object has been opened with a CommandTypeEnum value of adCmdTableDirect.

 

Note

 

The SQL Server 6.5 or 7.0 doesn't support the Seek or Index methods of the Recordset. You can however, use the Index and Seek method with an Access 2000 database and the OLE DB 4.0 Provider for Jet.

 

Valid XHTML 1.0 Transitional