How to determine number of records deleted in SQL DELETE query

  • Thread starter Thread starter PSI
  • Start date Start date
P

PSI

I'm driving an access database (Jet4.0) from a C++ application. I
would like to exhibit the same behavior as Access when deleting
records - e.g. display a message box with "you are about to delete xxx
records ... ".

I was intending to wrap the delete query with a transaction so I could
rollback if the user wants to cancel the delete.

Is there a way to get the number of records deleted? Or do I need to
do a SELECT query first to determine record count and then do the
delete.

TIA
Frank
 
Access supports the RowsAffected property so you can do the delete first,
check rows affected and perform some other action there.
 
Back
Top