?
Solved

searching in a recordset

Posted on 2000-05-09
4
Medium Priority
?
187 Views
Last Modified: 2010-08-05
I have a record set defined as follows:

Dim rs_VendorList As New ADODB.Recordset
    rs_VendorList.CursorLocation = adUseClient
  rs_VendorList.Open SQLquery, ConnectionString, adOpenDynamic

There are no problem using the recordset. Later in the code I get a value and I would like ot search for that value in the recordset. I have ound the "recordset.find" method but I cannot make it work. Can anyone help me with this one?




0
Comment
Question by:scotts27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Expert Comment

by:Tchalkov
ID: 2792981
try
 rs_VendorList.find <criteria>

 if rs_VendorList.Eof then
'not found
else
' found
end if
0
 
LVL 2

Accepted Solution

by:
BobbyOwens earned 200 total points
ID: 2792990
I have tried the following code using the .Find and it worked. What is the error you are getting back, or what is happening?

Dim arsTest As ADODB.Recordset
 
  Set arsTest = New ADODB.Recordset
  arsTest.ActiveConnection = pacnNavigatorData
  arsTest.CursorLocation = adUseClient
arsTest.Open "SELECT * FROM fst_system", , adOpenDynamic
  arsTest.Find "SystemID='7ae72a1c-d406-11d3-842a-000629a66eb4'"
  Set arsTest = Nothing

When you do the find, you need to enter the full criteria you are looking for. What is the back end database you are using?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2792995
Before calling the find method, use rs_VendorList.MoveFirst.

Also, be advised that the Find method allow only one criteria!
0
 

Expert Comment

by:rajeshkhatri
ID: 2795633
the syntax for finding the value in the recordset will be

rs.find <condition> , , as searchforward

rs is the recordset created through
set rs = new  ADODB.recordset

why searchforward because it search the record faster then other


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question