Solved

CRecordset: what's the fastest method?

Posted on 1998-05-07
2
207 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
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 70 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

14 Experts available now in Live!

Get 1:1 Help Now