How to sence changes in Access database

  • Thread starter Thread starter Max
  • Start date Start date
M

Max

It is a real problem but I'll try to formulate it in a sophisticated manner.

WE HAVE:
Application A writing something to MS Access database from time to time.

WE NEED TO IMPLEMENT:
Application B.
Application B should do some sort of processing each time the database was
changed.
Application B most likely will read data from the database using ADO.

Does anybody know a way to implement application B without polling the
database all the time.

Thank you.
 
It would be nice if there were an event indicating "something was changed",
but, alas, there is not one. Perhaps some research on various API calls
would give you a way to send a message between the two applications. Are
both these applications on the same LAN? Perhaps Application A could set a
particular field in a table in Application B when it makes a change in the
shared data and Application B could just wake up on a Timer or use the
approach in http://www.mvps.org/access/api/api0021.htm to sleep/wake
up/check/sleep.

Larry Linson
Microsoft Access MVP
 
Max said:
It is a real problem but I'll try to formulate it in a sophisticated
manner.

WE HAVE:
Application A writing something to MS Access database from time to
time.

WE NEED TO IMPLEMENT:
Application B.
Application B should do some sort of processing each time the
database was changed.
Application B most likely will read data from the database using ADO.

Does anybody know a way to implement application B without polling the
database all the time.

Aside from having Application B poll the database (or possibly check
some other file which would be written to by A), you might possibly have
Application A call some public routine in B. That depends, of course,
on how these applications are written and set up.
 
Dear Larry and Dirk

Thank you for taking time to answer me.

I also performed a research by myself and did not find a way to receive an
event when the database is changed.

If I was allowed to change "application A" I could implement a notification
mechanism. There are several ways to do it.

I am also aware of the possibility to use Sleep(n) function while doing the
polling, but it remains to be polling and it is not the best design.

One more thing I did not check yet is a possibility to wait until the *.mdb
file is changed. But I suspect that Access performs some sort of cashing and
does not write directly to disk each time a record is added.

If I was using SQL Server or any other "normal" database I could write a
trigger...

By now I am going to assume that the answer to my question is no.

Thank you for help once again. You gave me the confidence that I did not
miss something.
 
WE HAVE:
Application A writing something to MS Access database from time to time.

Application A should provide notification/denotification services.

Then Application B registers that it wants to be notified every time App A
makes a change to the data. At this point Application B does not need to
poll, it "wakes up" when it gets a notification message.

Denotification occurs when App B (e.g. when terminating) is longer
interested in receiving messages from A.

Stephen Howe
 
Back
Top