Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to find in recordset

Status
Not open for further replies.

sal0003

Programmer
Apr 5, 2010
22
IT
I need suggestion to find value in recorset....

wath is the best:

- seek

- .find

- SQL1 = "SELECT filed FROM table WHERE filed='" & abc & "'"
Set RS3 = CN1.Execute(SQL1)
If Not RS3.EOF Then
...
end if

tks.

note:
i use tipical ado conn and access mdb in c:\....
 
I can't remember the last time I tried to "find" something in a recordset. I just use an SQL statement that will return the record I'm looking for in the first place.
 

Most of the times I just use Filter on the recordset.

Have fun.

---- Andy
 
Seek and Find have different capabilities and limitations. Which is best depends on what you are trying to do and (in the case of Seek) what indexes you have available.

Check out the Seek Method and the Find Method at MSDN.
 
... in access table have 4.878.543 records in the field!:)
 
sal0003 said:
... in access table have 4.878.543 records in the field!
Please don't tell me you are opening a recordset with 5 million records! That would simply be crazy.
 
<I can't remember the last time I tried to "find" something in a recordset. I just use an SQL statement that will return the record I'm looking for in the first place.

Sure, but let me mention to the OP that there's still a place for the Find method or the Filter property, since each time you do this it makes a server round trip. I prefer to use Filter over Find though. It's more flexible in most cases. For example, if you want to iterate only those records in an existing recordset that meet certain criteria, the code is less complicated when you use Filter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top