ee_lcpaa
asked on
Sorting of a DataBase
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!!!
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!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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