Solved

Sorting of a DataBase

Posted on 1998-09-08
2
133 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Creating Labels and Frequency list style reports in SAS code 9 113
List out all word 7 335
WinWaitActive parameters 12 31
Change owner from userA to server Local Administrators 7 71
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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