Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CRecordset: what's the fastest method?

Posted on 1998-05-07
2
Medium Priority
?
215 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

971 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