Solved

Invoke a sql job when MS Access table is updated

Posted on 2012-03-30
5
346 Views
Last Modified: 2012-04-02
I would like to invoke a sql job when a table in Access 2010 is changed or a macro is run.  The database is saved somewhere on the network.  I would like to run the sql job when specific macro is run or table is updated.  Is there a way to do this?  thanks
0
Comment
Question by:karinos57
  • 2
  • 2
5 Comments
 
LVL 16

Expert Comment

by:DcpKing
ID: 37789148
If the Access system is using linked tables then you can place update triggers on the tables you want to watch. The triggers can cause something to happen ....... for example, we have an email process that watches a table for emails to be sent - if a job drops something into the correct table the job takes it and emails it out. You  could do something like that.

So far as macros are concerned, that would be more difficult - you'd need to build something into the macro code ...
0
 
LVL 77

Expert Comment

by:peter57r
ID: 37790179
The 'trigger' feature in Access 2010 accdb files referred to by DepKing is called 'Data Macros' .  This is new in A2010 - there is a tutorial here:
http://www.youtube.com/watch?v=Va6dmZHAmYU.

As DepKing says you have to make changes to the Access database to achieve either/both of your aims.
0
 

Author Comment

by:karinos57
ID: 37793196
thanks but i can't seem to see exactly what i need to accomplish here.  is there any other ideas or ways to do this?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 37795021
In server databases such as sql Server and Oracle they use a feature called 'triggers' to respond to changes made to data where those changes are made via the table directly.
Access 2010 implements Data Macros which provides similar functionality to triggers.  Prior to A2010 it has never been possible to detect changes made directly to tables.

So No - there is no other way unless you are in complete control of ALL changes made to the database.  Then wherever your application makes such a change you can add code to that process to report back to you.  But obviously you have to make this change to every possible point in your application where you might change a field value.

If it possible for another application to make changes to the same data then your only solution is Data Macros.
0
 

Author Closing Comment

by:karinos57
ID: 37798330
thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now