Solved

CRecordset: what's the fastest method?

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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