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. CRecordset old data problem

CRecordset old data problem

Scheduled Pinned Locked Moved C / C++ / MFC
databasedata-structuresperformancehelpquestion
4 Posts 3 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.
  • E Offline
    E Offline
    eyalle
    wrote on last edited by
    #1

    Hello all I've implemented a class dervied from CRecordset. this class gets the DB and sql query and retrives data. everything was working fine, untill i've decided to delete the data directly from the DB. when i'm running the same code, the class retrives the same data, although the data is erased. what's the problem ??

    CSpecificGraphsRS rsSpeGraphs(&m\_db);
        strQuery.Format("SELECT \* FROM GRAPHS ORDER BY GRAPH\_ID"); //empty result query
    rsSpeGraphs.Open(CRecordset::snapshot, strQuery, CRecordset::none);
    while (!rsSpeGraphs.IsEOF()) 
    {
               //gets in this while although the query is empty in DB
               //but actually the value is passed
              //seems like it keeps it somewhere in the memory
          genGraphDisplay.strGraphId = rsSpeGraphs.m\_GRAPH\_ID;
        }
    
    L D 2 Replies Last reply
    0
    • E eyalle

      Hello all I've implemented a class dervied from CRecordset. this class gets the DB and sql query and retrives data. everything was working fine, untill i've decided to delete the data directly from the DB. when i'm running the same code, the class retrives the same data, although the data is erased. what's the problem ??

      CSpecificGraphsRS rsSpeGraphs(&m\_db);
          strQuery.Format("SELECT \* FROM GRAPHS ORDER BY GRAPH\_ID"); //empty result query
      rsSpeGraphs.Open(CRecordset::snapshot, strQuery, CRecordset::none);
      while (!rsSpeGraphs.IsEOF()) 
      {
                 //gets in this while although the query is empty in DB
                 //but actually the value is passed
                //seems like it keeps it somewhere in the memory
            genGraphDisplay.strGraphId = rsSpeGraphs.m\_GRAPH\_ID;
          }
      
      L Offline
      L Offline
      loyal ginger
      wrote on last edited by
      #2

      Did you make sure your program is accessing the same database that you directly deleted data from? Sometimes multiple test databases are used and the wrong one may be modified, making you believe that the program is not working.

      E 1 Reply Last reply
      0
      • L loyal ginger

        Did you make sure your program is accessing the same database that you directly deleted data from? Sometimes multiple test databases are used and the wrong one may be modified, making you believe that the program is not working.

        E Offline
        E Offline
        eyalle
        wrote on last edited by
        #3

        yes i did, they access the same DB.

        1 Reply Last reply
        0
        • E eyalle

          Hello all I've implemented a class dervied from CRecordset. this class gets the DB and sql query and retrives data. everything was working fine, untill i've decided to delete the data directly from the DB. when i'm running the same code, the class retrives the same data, although the data is erased. what's the problem ??

          CSpecificGraphsRS rsSpeGraphs(&m\_db);
              strQuery.Format("SELECT \* FROM GRAPHS ORDER BY GRAPH\_ID"); //empty result query
          rsSpeGraphs.Open(CRecordset::snapshot, strQuery, CRecordset::none);
          while (!rsSpeGraphs.IsEOF()) 
          {
                     //gets in this while although the query is empty in DB
                     //but actually the value is passed
                    //seems like it keeps it somewhere in the memory
                genGraphDisplay.strGraphId = rsSpeGraphs.m\_GRAPH\_ID;
              }
          
          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Are the records in the set truly deleted? Try:

          while (! rsSpeGraphs.IsEOF())
          {
          if (rsSpeGraphs.IsDeleted())
          TRACE(_T("Recod is deleted.\n"));

          rsSpeGraphs.MoveNext();
          

          }

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          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