CREATE DATABASE AUDIT SPECIFICATION (Transact-SQL). CREATE DATABASE AUDIT SPECIFICATION audit. Program Files Microsoft SQL Server MSSQL13.MSSQLSERVER. Hi Everyone, I need to know how to create an Audit trail for changes made to a already existing ms access file. This file consists of certain details, which is entered / edited/ deleted on a frequent basis. If I allow specific logins to all the users. How can I check which user made what changes at a given point of time. I need to store the following information in a table for future use: 1 Operator name 2 Date (will be sys date) 3 Time (will be sys time) 4 Fieldchanged 5 Original value 6 Changed value I have heard something about 'screen.activecontrol'. If this is helpful how do I use it in resolving my issue. Hi Everyone, I need to know how to create an Audit trail for changes made to a already existing ms access file. This file consists of certain details, which is entered / edited/ deleted on a frequent basis. If I allow specific logins to all the users. How can I check which user made what changes at a given point of time. I need to store the following information in a table for future use: 1 Operator name 2 Date (will be sys date) 3 Time (will be sys time) 4 Fieldchanged 5 Original value 6 Changed value I have heard something about 'screen.activecontrol'. If this is helpful how do I use it in resolving my issue. Thanx When a form with subform is displayed and edits are being done to the subform the active form is the parent form and not the subform. This seems to be the effect that this line in the Audit Trail had: Set frm = Screen.ActiveForm A solution: 1. Pass the form as an argument of the function Function AuditTrail(frm as Form) 2. Comment out these lines in the code 'Dim frm as Form 'Set frm = Screen.ActiveForm 3. Call the function in the BeforeUpdate event of the form and or subform as follows: Call AuditTrail(Me). Browne's solution is very comprehensive, but here are a couple things to note: 1. A log table is required for every table that you wish to audit 2. Every edit will generate two rows that hold the entire record (before & after) 3. Failed edits are not logged 4. Quite a bit of code is required to be added to each form Items 1 & 2 will grow your database file size considerably, especially if you have many tables to audit, the table rows are very wide, or you have many frequent edits to existing records. Item 3 means that users who start an edit and then cancel, or are unable to save for some reason, will not be revealed in the logging tables. I wrote a blog entry that provides for basic change tracking using a single table. It also records which form and which computer was used, but does not track deletes - I don't allow users to delete records - I use a 'Delete' checkbox on each form that lets me hide the 'deleted' records from queries & code ( and users ) - this effectively allows an Undo for 'deleted' records. My solution requires adding two code modules and the tracking table. The basic setup is that for each form, you set the Tag = the name of table being edited, and you place the table's primary key on the form (can be hidden) and set the Tag for that control to 'PK'. Then, in the BeforeUpdate event you invoke the tracking code using TrackChanges Me.so only one line of code is required. If you have any subforms, you make the same alterations to those forms as well. I would certainly appreciate any comments or suggestions about my approach.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2018
Categories |