Home |
About me |
EXCEL
VB Programming (XL97-2003) |
ACCESS Programming |
EXCEL VB.Net Programming |
EXCEL Spreadsheet Functions |
Material Management | Guestbook
|
ADO Seek MethodThe Seek method searches the index of a Recordset to find a record that matches the values specified in the keyvalues parameter. If there is a match, the pointer will point to the record specified by the seekoption parameter. If there is no match, the record pointer will be placed at the end of the Recordset. Note: Set the Index property to the desired index before executing this method. This method can only be used with server-side cursors (not supported when the CursorLocation property value is adUseClient). This method can only be used when the Recordset object was opened with the CommandTypeEnum value of adCmdTableDirect. Syntax
|
Option Compare Database
Option Explicit
Function SeekRecord()
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Set conn = New ADODB.Connection
Set rst = New ADODB.Recordset
'Set the connection properties and open the connection.
With conn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "
|
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 |