Solved

searching in a recordset

Posted on 2000-05-09
4
179 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
4 Comments
 
LVL 2

Expert Comment

by:Tchalkov
Comment Utility
try
 rs_VendorList.find <criteria>

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

Accepted Solution

by:
BobbyOwens earned 50 total points
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now