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. hmmm DAO !!! 3 question ???

hmmm DAO !!! 3 question ???

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasequestionannouncement
3 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.
  • A Offline
    A Offline
    Ahmad
    wrote on last edited by
    #1

    Hi :) I have some question about DAO : 1 - When I use MFC wizard there is three choice (Snapshot , Dynaset , Table),so what difference ... 2 - If my access file has two tables I have two problems : A- How I can determine which table I want to add record ... B- When I use code like this m_pSet->AddNew(); m_pSet->m_id=1; //table 1 m_pSet->m_name="Ahmad"; //table 1 m_pSet->m_id2=1; //table 2 m_pSet->m_phone=21598356; //table 2 m_pSet->Update(); a meesage box appeare and tell me that : Can't update. Database or object is read only 3- How I can use SQL statements with VC++ 6 ... Thank you AHMAD ALWASHALI

    S 1 Reply Last reply
    0
    • A Ahmad

      Hi :) I have some question about DAO : 1 - When I use MFC wizard there is three choice (Snapshot , Dynaset , Table),so what difference ... 2 - If my access file has two tables I have two problems : A- How I can determine which table I want to add record ... B- When I use code like this m_pSet->AddNew(); m_pSet->m_id=1; //table 1 m_pSet->m_name="Ahmad"; //table 1 m_pSet->m_id2=1; //table 2 m_pSet->m_phone=21598356; //table 2 m_pSet->Update(); a meesage box appeare and tell me that : Can't update. Database or object is read only 3- How I can use SQL statements with VC++ 6 ... Thank you AHMAD ALWASHALI

      S Offline
      S Offline
      Steen Krogsgaard
      wrote on last edited by
      #2

      Here's some short replies. I really recommend that you read some books on the subject, as it is a huge one. "Microsoft Jet Database Engine Programmers Guide" used to be online on MSDN, but I can't find it there anymore. It's a bit outdated anyway, but gives you a good grip on DAO (although it's written for VB!!!). If you have some MSDN Library CD's from last year I guess it will be there. The answers: 1: snapshot: the resultset is a snapshot of the data in the database. Changes to the data in the db after the snapshot is opened is not reflected in the snapshot. The snapshot is read-only (and I vaguely remember something about it being forward-only also). Dynaset: the resultset represents the actual data in the database at the time you fetch (i.e. read) the data. Updateable. Snapshots and Dynasets are the result of a query, i.e. an SQL statement. Table: as Dynaset, but gives you all the fields of one particular table. Among other things very useful if you want to browse the table, or as a basis for a data-entry form in your program. 2: You probably asked for a snapshot - they're read-only. 3: Use a QueryDef object. Here you can set the SQL text. good luck Steen

      A 1 Reply Last reply
      0
      • S Steen Krogsgaard

        Here's some short replies. I really recommend that you read some books on the subject, as it is a huge one. "Microsoft Jet Database Engine Programmers Guide" used to be online on MSDN, but I can't find it there anymore. It's a bit outdated anyway, but gives you a good grip on DAO (although it's written for VB!!!). If you have some MSDN Library CD's from last year I guess it will be there. The answers: 1: snapshot: the resultset is a snapshot of the data in the database. Changes to the data in the db after the snapshot is opened is not reflected in the snapshot. The snapshot is read-only (and I vaguely remember something about it being forward-only also). Dynaset: the resultset represents the actual data in the database at the time you fetch (i.e. read) the data. Updateable. Snapshots and Dynasets are the result of a query, i.e. an SQL statement. Table: as Dynaset, but gives you all the fields of one particular table. Among other things very useful if you want to browse the table, or as a basis for a data-entry form in your program. 2: You probably asked for a snapshot - they're read-only. 3: Use a QueryDef object. Here you can set the SQL text. good luck Steen

        A Offline
        A Offline
        Ahmad
        wrote on last edited by
        #3

        Thank you very much,your answer was very useful ...:) AHMAD ALWASHALI

        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