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. General Programming
  3. C / C++ / MFC
  4. Error in recordset retrieval

Error in recordset retrieval

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpc++
4 Posts 2 Posters 0 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.
  • N Offline
    N Offline
    namratab
    wrote on last edited by
    #1

    Hello, I have a query regarding recordset retrieval. This is what I have so far. 1.An SDI application(name:Database) without database support and CDatabaseView derived from CFormView 2.A second dialog(name:Dialog1) and its class Cdialog1. 3.A new MFC class CMySet derived fron Crecordset. 4.CDialog1 has a foreign variable m_pSet of type CMySet The DB connection opens properly using CDatabse.OpenEx() then i have the following code to open a recordset. "user" is one of the tables I have selected. CDialog1 dlg; dlg.m_pSet = new CMySet(m_pDB); str = "SELECT * FROM User;"; dlg.m_pSet->Open(AFX_DB_USE_DEFAULT_TYPE,str,CRecordset::none) I get an error at this point, while executing,saying "error retrieving record".Actually on clickin a button on the first main form(which just has a pic) I wanted to have a screen for username and password whiich has to be verified from the DB. Am i wrong in my approach somewhere. the application builds and compiles jus fine. Kindly help.

    D 1 Reply Last reply
    0
    • N namratab

      Hello, I have a query regarding recordset retrieval. This is what I have so far. 1.An SDI application(name:Database) without database support and CDatabaseView derived from CFormView 2.A second dialog(name:Dialog1) and its class Cdialog1. 3.A new MFC class CMySet derived fron Crecordset. 4.CDialog1 has a foreign variable m_pSet of type CMySet The DB connection opens properly using CDatabse.OpenEx() then i have the following code to open a recordset. "user" is one of the tables I have selected. CDialog1 dlg; dlg.m_pSet = new CMySet(m_pDB); str = "SELECT * FROM User;"; dlg.m_pSet->Open(AFX_DB_USE_DEFAULT_TYPE,str,CRecordset::none) I get an error at this point, while executing,saying "error retrieving record".Actually on clickin a button on the first main form(which just has a pic) I wanted to have a screen for username and password whiich has to be verified from the DB. Am i wrong in my approach somewhere. the application builds and compiles jus fine. Kindly help.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      namratab wrote:

      I get an error at this point, while executing,saying "error retrieving record".

      So why don't you step into the Open() call to see what's going on?


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      N 1 Reply Last reply
      0
      • D David Crow

        namratab wrote:

        I get an error at this point, while executing,saying "error retrieving record".

        So why don't you step into the Open() call to see what's going on?


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        N Offline
        N Offline
        namratab
        wrote on last edited by
        #3

        ACtually, the exact same Open call worked in another small aplication. The only difference was that the object invoking the Open() method was of type REcordSEt...and in my case it is of a type MySEt ( derived from recordSEt)

        D 1 Reply Last reply
        0
        • N namratab

          ACtually, the exact same Open call worked in another small aplication. The only difference was that the object invoking the Open() method was of type REcordSEt...and in my case it is of a type MySEt ( derived from recordSEt)

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          But until you actually step into the Open() call, you'll not know the cause of the error. I've only done one article dealing with record sets. See if this is of any help.


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          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