f_Audit() will add auditing fields to a table, auditing based field rules, and a simple audit review form and report.
The auditing field rules where copied from Peter Wayne's "Xbasic for Everyone" with a few minor differences. Other snippets of code where copied from the Alpha5 forum. I would like to thank Cal Locklin, Tom Cone Jr, & Peter Wayne for continual posting of advanced concepts and how to's. Without which this function would not have been finished.
f_Audit will modify the table structure and field rules of tables it is ran against.
Added fields
Created_By_f, character, length of 30
Created_On_f, Time
Changed_By_f, character, length of 30
Changed_On_f, Time
Unique_ID_f, character, length of 36
Both Created_By and Changed_By are populated via API_GETUSERNAME()
Changed_On and Changed_By are populated via NOW()
Unique_ID is populated by API_UUIDCREATE()
Modified Record Events
CanSaveRecord
OnSaveRecord
OnEnterRecord
OnChangeRecord
CanDeleteRecord
OnDeleteRecord
Added tables - will be added in the same folder as the database
Audit.dbf
Changes.dbf
Added forms
Audit_frm
Added reports
Changes_Rpt
How to use
In the zipped file is a folder called "Tools_dB". The "Tools_DB" folder needs to be copied to the root of the c: drive.
Audit.table needs to be copied to C:\Program Files\A5V8\Control_Panel_Addins
Audit.aex can be copied to C:\Program Files\A5V8\Addins_installed.
Open a test database, right click on a table, select Addins, Add Auditing. This will add the needed fields and the auditing record events to your table. It will also add the Audit.dbf to the database and the Audit_frm. Modify/Add/delete a record in the newly audited table. Open the audit_frm to see a simple view of what was modified. Click Report Differences for a hardcopy of the changes. "Report Differences" will add the change.dbf table and the changes_rpt report to the database if they are not currently there.
The auditing field rules where copied from Peter Wayne's "Xbasic for Everyone" with a few minor differences. Other snippets of code where copied from the Alpha5 forum. I would like to thank Cal Locklin, Tom Cone Jr, & Peter Wayne for continual posting of advanced concepts and how to's. Without which this function would not have been finished.
f_Audit will modify the table structure and field rules of tables it is ran against.
Added fields
Created_By_f, character, length of 30
Created_On_f, Time
Changed_By_f, character, length of 30
Changed_On_f, Time
Unique_ID_f, character, length of 36
Both Created_By and Changed_By are populated via API_GETUSERNAME()
Changed_On and Changed_By are populated via NOW()
Unique_ID is populated by API_UUIDCREATE()
Modified Record Events
CanSaveRecord
OnSaveRecord
OnEnterRecord
OnChangeRecord
CanDeleteRecord
OnDeleteRecord
Added tables - will be added in the same folder as the database
Audit.dbf
Changes.dbf
Added forms
Audit_frm
Added reports
Changes_Rpt
How to use
In the zipped file is a folder called "Tools_dB". The "Tools_DB" folder needs to be copied to the root of the c: drive.
Audit.table needs to be copied to C:\Program Files\A5V8\Control_Panel_Addins
Audit.aex can be copied to C:\Program Files\A5V8\Addins_installed.
Open a test database, right click on a table, select Addins, Add Auditing. This will add the needed fields and the auditing record events to your table. It will also add the Audit.dbf to the database and the Audit_frm. Modify/Add/delete a record in the newly audited table. Open the audit_frm to see a simple view of what was modified. Click Report Differences for a hardcopy of the changes. "Report Differences" will add the change.dbf table and the changes_rpt report to the database if they are not currently there.
Comment