Solved

Invoke a sql job when MS Access table is updated

Posted on 2012-03-30
5
343 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

758 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

22 Experts available now in Live!

Get 1:1 Help Now