Mostafa Shahto

I am working on an alarm application that has to be more or less real time. In case of an event, a new record is inserted into an Access database in a table named "Events". I need a way to either "detect" this insertion of a new row, or getting this row automatically in a recordSet sent to my VC++ application. Please advice on how to implement this or anyother alternative...

Thank you



Re: Visual C++ General Getting MS Access Updated/Inserted rows

Sahir Shah

You can use the FileSystemWatcher class to monitor the mdb file and notify your application of any changes to the file. Once you receive notification of a change you can query the table to identify changes. You need to have an "AutoNumber" field in the table so you can know if a new row was added when you query the table.





Re: Visual C++ General Getting MS Access Updated/Inserted rows

Simple Samples

The answer depends on the database server/system. If it is SQL Server you will get better answers in the SQL Server forum. It has been a while since I researched something such as this but a SQL Server specialist might tell you to look at triggers. I am not sure if that would help, but I don't know what database you are using.