• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3736
  • Last Modified:

Distinct Values in the RecordSet

hi experts,
  I have the recordset.  How do i get the distinct values in recordset.  Please note that I cannot modify the source.  Please let me know how this can be done.  I have to used find and filter property but could achive the desired result

Thanks
0
ajexpert
Asked:
ajexpert
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
You will need to sort the recordset and loop through each row to detect when the value change. There is nothing else you can do on an already opened recordset
0
 
bangerarunCommented:
Dear when you are creating the recordset i think you have to enter the query for distinct recordset

any you will get the records in disinct way

Banger
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Shiju SasidharanAssoc Project ManagerCommented:
hi
i think bangerarun is right
u can change ur SQL Query like this
'-------------------------------------

SELECT DISTINCT *  FROM Your_Table_Name

'-------------------------------------
this will return only distinct rows from the table Your_Table_Name

;-)
Shiju

0
 
ajexpertAuthor Commented:
bangerarun, shijusn
 My query clearly says I cannot modify the source i.e. I cannot modify the query.  I have to play with recordset only to get distinct values
0
 
Shiju SasidharanAssoc Project ManagerCommented:
hi ajexpert
ok , u need to findout distint values in a particular filed or need to findout distinct rows in the recordset ?
to extract distict values from a selected filed
it is better to add entry from the record set to a ListView and use the method
ListView1.FindItem to check whether u have already entered this entry  , if so skip and try with the next record in the field

This is not a direct method to solve ur problem . anyway it will work to filter record set

;-)
Shiju
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now