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