Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CRecordset: what's the fastest method?

Posted on 1998-05-07
2
Medium Priority
?
213 Views
Last Modified: 2013-11-20
I am using the CDatabase and CRecordset classes to implement an ODBC application.  With the CRecordset class, there are two ways to get to records in a recordset - using the MoveNext() function which scrolls to the next record, which means you have to observe your member variables to see if they match your criteria.  Then there's using the strFilter string which is basically a SQL WHERE clause that can be used when you call Open().  It returns your recordset.  Since I am trying to locate a single record, which one would get faster results from the database?  I am wanting to do this process repeatedly.  Thanks in advance...
0
Comment
Question by:oceanic
[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
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 210 total points
ID: 1308373
Use WHERE. It lets the server do the work, and the server is better equipped than your client machine to find the record.  Plus, you'll avoid all the overhead in sending, binding, retrieving, allocating, and copying the records as you paw through the result set.

.B ekiM

0
 

Author Comment

by:oceanic
ID: 1308374
Thanks mikeblas!  This is the type of answer I was looking for.
oceanic
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

688 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