Solved

CRecordset: what's the fastest method?

Posted on 1998-05-07
2
209 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

776 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