PDA

Click to See Complete Forum and Search --> : Seeking


rezania
Aug 13th, 2000, 10:37 AM
Hi
I am having difficulties using SEEK statement on a recordset.
I use Jet OLEDB ver 4.0. with Access 2000.
The message says the provider does not support this.
How can I get around this? sample codes are welcomed.
thanks
Rezania

parksie
Aug 13th, 2000, 10:58 AM
Why do you need to SEEK? Do you just want to return all the recordset items?

Clunietp
Aug 14th, 2000, 10:51 AM
the FIND method is easier to use...why exactly do you need to use SEEK?

Find method:

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=nwind2k.mdb"

rs.CursorLocation = adUseClient
rs.Open "Select * from Customers", cn, adOpenStatic, adLockReadOnly, adCmdText

rs.Find "[CustomerID] = 'ALFKI'"

If rs.EOF Then
MsgBox "Not Found!"
Else
MsgBox "Found!"
End If