RecordsAffected Property Example (VC++)

This example prints the number of records updated by an action query.

CdbDBEngine      dbeng;
CdbDatabase      dbsBiblio;
long            lTotal;
   
dbsBiblio = dbeng.OpenDatabase(_T("Biblio.mdb"));
dbsBiblio.Execute(_T("Update Titles Set [Year Published] = 1994 
Where Title = 'To Kill an SQL Query'"));
lTotal = dbsBiblio.GetRecordsAffected();
printf("%d records were changed.", lTotal);
dbsBiblio.Close();