Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Distinct Values in the RecordSet

Posted on 2004-10-21
8
Medium Priority
?
3,169 Views
Last Modified: 2013-11-26
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
Comment
Question by:ajexpert
[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
8 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 12372123
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
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12372225
0
 
LVL 1

Expert Comment

by:bangerarun
ID: 12387320
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 14

Expert Comment

by:Shiju Sasidharan
ID: 12442586
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
 
LVL 14

Author Comment

by:ajexpert
ID: 12492476
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
 
LVL 14

Accepted Solution

by:
Shiju Sasidharan earned 200 total points
ID: 12492883
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

636 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