Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Select DISTINCT and CRecordSet

Select DISTINCT and CRecordSet

Scheduled Pinned Locked Moved Database
databasequestion
5 Posts 3 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Derek Price
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • D Derek Price

      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

      C Offline
      C Offline
      Carlos Antollini
      wrote on last edited by
      #2

      Using CRecordset::Open(); in the second parameter you can write your sql string. Open(CRecordset::dynaset, "Select Distinct * from table where..."); Cheers!!! ;) Carlos Antollini.

      D 1 Reply Last reply
      0
      • C 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.

        D Offline
        D Offline
        Derek Price
        wrote on last edited by
        #3

        What if I already have a derived CRecordSet class like: class CEmployeesRecordSet : public CRecordSet { ... } Is there anyway to do it from this class?

        L C 2 Replies Last reply
        0
        • D Derek Price

          What if I already have a derived CRecordSet class like: class CEmployeesRecordSet : public CRecordSet { ... } Is there anyway to do it from this class?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          If you can't answer that question yourself you need switch to VB or other languages where you won't hurt yourself.

          1 Reply Last reply
          0
          • D Derek Price

            What if I already have a derived CRecordSet class like: class CEmployeesRecordSet : public CRecordSet { ... } Is there anyway to do it from this class?

            C Offline
            C Offline
            Carlos Antollini
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups