Select DISTINCT and CRecordSet
-
Hello, Is there any way to "select distinct" after deriving a CRecordSet class? I have a rather large table that has a small number of distinct values I'm looking for. Using "select distinct" works well when I query the database using a database viewer, but I'm not sure how I would do this in the derived CRecordSet class. Is there a way? Thanks in advance! Derek
-
Hello, Is there any way to "select distinct" after deriving a CRecordSet class? I have a rather large table that has a small number of distinct values I'm looking for. Using "select distinct" works well when I query the database using a database viewer, but I'm not sure how I would do this in the derived CRecordSet class. Is there a way? Thanks in advance! Derek
Using CRecordset::Open(); in the second parameter you can write your sql string. Open(CRecordset::dynaset, "Select Distinct * from table where..."); Cheers!!! ;) Carlos Antollini.
-
Using CRecordset::Open(); in the second parameter you can write your sql string. Open(CRecordset::dynaset, "Select Distinct * from table where..."); Cheers!!! ;) Carlos Antollini.
What if I already have a derived CRecordSet class like: class CEmployeesRecordSet : public CRecordSet { ... } Is there anyway to do it from this class?
-
What if I already have a derived CRecordSet class like: class CEmployeesRecordSet : public CRecordSet { ... } Is there anyway to do it from this class?
-
What if I already have a derived CRecordSet class like: class CEmployeesRecordSet : public CRecordSet { ... } Is there anyway to do it from this class?
Yes, You don't have problem with that. You only need to use the open method in your class. Your class is derived from the CRecordset class, is for this that you don't have problem. Cheers!!! ;) Carlos Antollini.