Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ADO database searching

Posted on 2001-06-10
3
Medium Priority
?
171 Views
Last Modified: 2013-11-13
I am using MS ADO 2.6 and I want to know how do I search a column for a certain entry.  I have a table called UserLog with columns called: Name, Date, Time.  The Name column has an index called PrimaryKey to prevent multiple entries.  How do I search the Name column for an entry called John Doe and will find it fast(I have a lot of entries in the database)?

This is my code to connect to the database:

Private Sub Command1_Click
Dim ILConnect As New ADODB.Connection
Dim ILRecordset As New ADODB.Recordset
ILConnect.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=C:\windows\desktop\dfd.mdb"
ILRecordset.LockType = adLockPessimistic
ILRecordset.Open "UserLog", ILConnect, , , adCmdTable
End Sub
0
Comment
Question by:vpl4
[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
3 Comments
 
LVL 6

Accepted Solution

by:
JonFish85 earned 200 total points
ID: 6174797
ILRecordset.Execute "SELECT * FROM TableName WHERE name='John Doe'"
ILRecordset.Refresh
Try that
0
 

Expert Comment

by:qazafiq
ID: 6175975
First of all if your planning to use ACCESS database only then there is nothing better than DAO.

Anyway thats just a thought, but do you really want to be going to the database everytime you make a search?

I dont think that would be a wise thing to do. Why dont we open a recordset containg all the data of the table, yes it would take long the first time it opens but after that all we need to do is filter our recordset. This would be alot faster.
0
 

Author Comment

by:vpl4
ID: 6179749
I think I submitted the question twice but got two different answers.  They both work and they give me two options to choose from.  Thanks for your assistance.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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.
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
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

610 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