Event when Access table is accessed through ODBC ?

  • Thread starter Thread starter Sverk
  • Start date Start date
S

Sverk

Hi,
I have an Access 2007 table of photo-films and I use IMage for handling of
digitized photos.
I need to link these two applications in certain ways.
From IMage I am able to access the Access table through ODBC, read and
update etc.
Fine, and next thing is to get Access to synchronize with these ODBC calls.
Whenever IMage calls on a record in the Access table, I want Access to
display that record in a form, or something like that.
So here are my questions:
Assuming the Access database is open, what I need is an event that gets
triggered when it is accessed from another application through ODBC.
Is there any? Where do I find it?
And, how do I know in the Access code which record is being accessed?

See what I mean?
Help please,
 
Sorry, but there are no table-level events. Its only at the form or report
level. Also, while Client-Server based databases allow you set Triggers on a
table (code that executes when a record is INSERTED, UPDATED or DELETED),
there's nothing to my knowledge that checks when a table is being otherwise
accessed - as in Read. That'd be more of a function of the engine driving the
database.
 
OK, thanks, I see.
Then I figure I might get my thing done by having IMatch not just making a
Read but also an insignificant Update to the record in the Access table, just
to trigger the code in there.
Thus what you say, "Client-Server based databases allow you set Triggers on a
table (code that executes when a record is INSERTED, UPDATED or DELETED)",
that could be what I need.
Could you please indicate how to set up such a trigger?
Is there a special way for such triggers?
Or would it simply(???) be like if the table is open and showing in a form
there would occur a useful form-event whenever a record in the table is
updated through ODBC?
Would it then also indicate which record was updated?
All help appreciated,
 
Access does not support triggers. At the table level, Access has no way of
knowing that anything at all has been done to the records.

Access is a file-based database which means that all data is stored in a
file and its up to the application running on your PC to work with it. A
Client-Server database has two parts - the part on the PC (Client) that makes
the request to the server. Only Client-Server databases, such as SQLServer,
Oracle, etc, support triggers.
 
Another setback -- thanks anyway.
But how about this:
1/ In the Access table I keep a special record for this linking purpose.
2/ IMatch code then writes to (updates) this record & field the record
number (or similar) that it wants Access to show.
3/ Access has a routine that keeps watching this linking record.
4/ When there is a change in there Access updates the form it is showing
with data from the requested record. Done!?
I can see at least one problem: If Access is watching that record for
changes through a loop that reads it all the time it wouldn't be nice, and it
might choke the processor.
Could of course set a timer to make it check only once per second or so.
But the crucial thing is then is whether and how a change in the database
file (through ODBC) is reflected in a form that is showing data from that
table.
Would it require repeating refreshes or what?

So, if you can bear with all this, any comments to this last chance?
 
That is entirely possible. You'll be using a hidden form with code behind its
onTimer() event - along with a value for the Timer property (The Timer
property determine how often the onTimer Event occurs.
 
Back
Top