Does anyone know of a way to detect when the last time a Microsoft Access table has been changed (inserted into or updated)? We used OLEDB via ADO COM to communicate with an access database programmatically and were looking for a way of detecting changes to specific tables. We don’t need to know what those changes are, just that changes were made.
Share
The only way to detect if data in the table has changed is to perform a query against the table.
You must add a column of type
DATETIMEto the table e.g. namedLastUpdatedDatethat indicates the last updated date/time of each row. Make itNOT NULLso that you will have to write an updatedDATETIMEvalue to that column for eachINSERTorUPDATE. Also, set the column to have a default ofDATE()for the current date stamp orNOW()for the current date/time stamp. Then add a Validation Rule orCHECKconstraint e.g.CHECK (LastUpdatedDate = NOW())to ensure the column is actually updated on eachUPDATEandINSERT.Finally, run a
MAX(LastUpdatedDate)query and you will get what you need.