Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sorting of a DataBase

Posted on 1998-09-08
2
Medium Priority
?
136 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 120 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 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