Solved

Sorting of a DataBase

Posted on 1998-09-08
2
135 Views
Last Modified: 2013-11-20
Hi,

I have built a database from VB5.0.
Now, I try to do the sorting of the data of the database
by using the function -- CDaoRecordset::m_strSort

The remarks of this topic mentioned that:
Contains a string containing the ORDER BY clause of an SQL statement without the reserved words ORDER BY. You can sort on dynaset- and snapshot-type recordset objects.

Now I have a dynaset recordset objects. How can
I sort the specified column of my Database by the above
function or any other good method to implement this?

The fields of my database are as follows:

Direct Number, Extension Number, First Name, Last Name
I want to do the sorting for the direct number.
Thanks!!!
0
Comment
Question by:ee_lcpaa
[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
2 Comments
 
LVL 7

Accepted Solution

by:
psdavis earned 40 total points
ID: 1321903
You've basically got it.  In your CDaoRecordset, your m_strSort will look something like this (just guessing about your code)

CNameRecordset* pSet = ... (however you do it)
pSet->m_strSort = "[First Name]"
pSet->Requery( );

That should be it.  Good luck.

Phillip
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1321904
p.s.

For your specific answer.

pSet->m_strSort = "[Direct Number]";
pSet->Open( ... );

If this is your first time to open the recordset, you can do this right before the 'Open' and you can skip the Requery.  Otherwise, you can do it dynamically the way I showed you the first time.

Phillip
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

617 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