0

I need to listen changes in MS Access database like inserting, updating deleting. Inserting is more imporrtant. Is there any way to accomplish this. I am using c# as front end.

Khan
  • 344
  • 1
  • 7
  • 21
Sony
  • 7,136
  • 5
  • 45
  • 68
  • 4
    This is not a good way to ask a question here. Did you try _anything_ so far to solve your problem? Show your effort first so people might show theirs. Please read [FAQ], [ask] and [help] – Soner Gönül Jun 06 '14 at 05:52
  • 2
    Try [triggers in access](http://office.microsoft.com/en-us/access-help/create-a-trigger-adp-HP003085415.aspx) beyond that, Soner is right. – crthompson Jun 06 '14 at 05:53
  • 1
    Change-synchronization can be performed without "listening": the actual goal/task should be well defined. – user2864740 Jun 06 '14 at 05:54
  • @Soner: I like the friendly way you treat newbies very much. But here I beg to differ. The question is short but fine by me and I would love to see an answer. Can a frontend listen/be notified about Access changing data? Can a trigger be propagated to a client without polling? – TaW Jun 06 '14 at 05:58
  • 1
    Well i think you are interested in a return in Primary key. This is why i think you said inserting is more important. SELECT SCOPE_IDENTITY() AS NewID after your insert statement. The answer is provided here http://stackoverflow.com/questions/8479315/sql-inserting-a-row-and-returning-primary-key other then this you can write your own functions to keep track of data records. – DrewGoldsberry Jun 06 '14 at 06:15
  • 1
    @sony Are you interested in changes made by your application only, or by other applications? This makes a huge difference in the approach. – C.Evenhuis Jun 06 '14 at 06:25
  • @C.Evenhuis, we have a thumb impression scanner, when a user places his thumb on it, a new row will be added in the database and i want to listen to this. That is why i said inserting is more important – Sony Jun 06 '14 at 06:37
  • @DrewGoldsberry, that will help me in the way :-) – Sony Jun 06 '14 at 06:40
  • 1
    possible duplicate of [How can I get notified in C# WinForms of external MS Access database updates?](http://stackoverflow.com/questions/3795670/how-can-i-get-notified-in-c-sharp-winforms-of-external-ms-access-database-update) – C.Evenhuis Jun 06 '14 at 06:41
  • @C.Evenhuis, i have seen that,but polling in regular intervals does not fixes my problem, because i want an instant notification. but polling the database continuously in an infinite loop in a separate thread fixes it. But does it cause any delay in other transaction in the database or is it a good way to do that? – Sony Jun 06 '14 at 06:54
  • @sony this seems like an extreme waste and could never be used in large scale data because every poll would take longer and longer. Why does the scope identy not work for you? I just think the tracking you would want instant feedback not a lag. – DrewGoldsberry Jun 06 '14 at 18:06
  • @DrewGoldsberry SCOPE_IDENTITY() doesn't work because that is for Sql Server not Access. Did you try it? `Undefined function 'SCOPE_IDENTITY()' in expression` – Brad Jun 06 '14 at 20:44
  • @sony if user scans their thumb and a new records is added are you listening for that in the current application or in some other app somewhere else? if it is in your current app there is no need to listen to the DB; you know that just happened because you just did it – Brad Jun 06 '14 at 20:58
  • @Brad we are using another application to listen to that – Sony Jun 07 '14 at 05:02

0 Answers0