2

I have an application using TADODataSet and TADOConnection to connect with SQL Server database.

I would like to detect any modification that happens in the database.

modifications = Insert, Update, Delete

I want to know which TADODataset or which table has been modified.

I'm doing this because I have a multi-user application that works over local network. The users may add, delete or edit records in tables so I want to refresh the datasets to show the new modifications.

Also I want this to build a log.

I don't want to use TTime to keep watching the modifications.
I don't want to use triggers

I prefer a message from TADOConnection.

I'm using SQL Server 2005 and Delphi 2007 with ADO components.

New modification : I need it on SQL Server 2000

Regards.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user1512094
  • 611
  • 2
  • 10
  • 23
  • 3
    It's called [`Query notifications`](http://msdn.microsoft.com/en-us/library/ms130764(v=sql.90).aspx) but ADO components [`doesn't support`](http://stackoverflow.com/a/10653497/960757) it. – TLama Aug 11 '12 at 09:47
  • how can I handle this notifications in Delphi if ADO Doesn't support it? – user1512094 Aug 11 '12 at 09:52
  • 2
    It's described in the post I've linked; you can try the [`WMI way`](http://stackoverflow.com/a/7843242/960757) described by RRUZ, purchase a commercial solution or write your own if you have time and experience :-) – TLama Aug 11 '12 at 09:59
  • 1
    Thank you very much for this useful information... :( I don't have time and I don't have the enough experience :(...am gonna try WMI WAY – user1512094 Aug 11 '12 at 10:16
  • how to get notification if I'm using SQL Server 2000? – user1512094 Aug 11 '12 at 10:47
  • Again I'll disappoint you (quite a bad start of my day), query notifications has been introduced in SQL Server 2005, so the SQL Server 2000 doesn't support them yet. – TLama Aug 11 '12 at 10:55
  • lool...it is okay...maybe if we can get any other way regardless the Query Notification... :( please help me...my boss will kick me if i don't make it :( – user1512094 Aug 11 '12 at 11:27
  • Then I would use triggers to log changes to a table like `TableName, ChangedAt` (for incremental log also `ChangeType` and `ChangedBy`) where I would log changes for each tracked table. From the client side I would poll this logging table and when I find a date time stamp (or a record) newer than the last read one, then refresh the client dataset. – TLama Aug 11 '12 at 11:49
  • ask your boss for this http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Maximilienne-p1000557.jpg/335px-Maximilienne-p1000557.jpg – mjn Aug 11 '12 at 11:49

1 Answers1

0

Maybe not the answer you expect but I think you should evaluate Bold for Delphi. My employer Attracs has successfuly used Bold over ten years in a big multiuser application. Bold have many features that simplify development when application grows and things got really complicated. Currently Bold do not support Unicode so it can only be used with D2007 or older. But we have plans to fix this in the future.

Bold solve your problem by having automatic updates of gui components when another user make changes to the database.

For more information about Bold see my blog at boldfordelphi.

Roland Bengtsson
  • 5,058
  • 9
  • 58
  • 99