473,791 Members | 3,193 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating an audit trail in Access 2000

Dear Sirs,

Having previously used other SQL implementations I have grown used to
having an audit trail to find when problems occured, the problem I am
increasingly finding with Access is that there is no 'inbuilt' audit
trail for me to see what has happend to the database to get it into its
current state.

Is there a way to make Access 2002 (in 2000 mode) to generate a log of
ALL changes to table data ? A time/datestamp to start with would be
good, but eventually with a source hostname/IP would be good.

Many thanks in advance for your kind help,
Regards,

Alan Knipmeyer.
--
IT Technician

Nov 13 '05 #1
5 2164
al***********@y ahoo.com wrote in message news:<10******* *************** @c13g2000cwb.go oglegroups.com> ...
Dear Sirs,

Having previously used other SQL implementations I have grown used to
having an audit trail to find when problems occured, the problem I am
increasingly finding with Access is that there is no 'inbuilt' audit
trail for me to see what has happend to the database to get it into its
current state.

Is there a way to make Access 2002 (in 2000 mode) to generate a log of
ALL changes to table data ? A time/datestamp to start with would be
good, but eventually with a source hostname/IP would be good.

Many thanks in advance for your kind help,
Regards,

Alan Knipmeyer.


See Allen Browne's website. He has code for this and instructions.
Nov 13 '05 #2
Chuck Grimsby <c.*******@worl dnet.att.net.in valid> wrote:
Allen Browne has an example of how to do it on his site however, and I
strongly encourage it's reading:
<http://members.iinet.n et.au/~allenbrowne/AppAudit.html>


I gratefully used Allen's method for ages but found that querying it took
ages too and it also stores a lot of static data. I developed my own method
of tracking changes which I'll evetually put on my web site.

I have the following code in my form's before update event (DAO in A97):

****
Dim ctl As Control
Dim db As Database, rs As Recordset, strSQL As String
Set db = CurrentDb
strSQL = "Select * From qryHistory;"
Set rs = db.OpenRecordse t(strSQL)

For Each ctl In Me.Detail.Contr ols
'Ignore controls such as labels
If ctl.Name Like "cmd*" Then GoTo Skip
If ctl.SpecialEffe ct = 0 Then GoTo Skip
If ctl.Name Like "txt*" Or ctl.Name Like "cbo*" Or ctl.Name Like
"ogr*" Or ctl.Name Like "chk*" Then
'Record null to value, value to null, and value changes
If (IsNull(ctl.Old Value) And Not IsNull(ctl.Valu e)) Or
(IsNull(ctl.Val ue) And Not IsNull(ctl.OldV alue)) _
Or ctl.OldValue <> ctl.Value Then
'MsgBox ctl.name
With rs
.AddNew
![DataSource] = "MyTable"
![ID] = Me.txtID
![FieldName] = ctl.ControlSour ce
![OldValue] = ctl.OldValue
![NewValue] = ctl.Value
![UpdatedBy] = CurrentUser
![UpdatedWhen] = Now()
.Update
End With
End If
End If
Skip:
Next

rs.Close
Set rs = Nothing
db.Close
Set db = Nothing

****

The code cycles through controls with data sources and fires the update
routine when it finds one that has changed. This keeps the amount of stored
data to a minimum and you can call the data from a 'history' form if you
want.

HTH - Keith.
www.keithwilby.com
Nov 13 '05 #3
Chuck Grimsby <c.*******@worl dnet.att.net.in valid> wrote:
You may want to look at using the TypeOf operator in your code to
select what controls for your code to work on/with


Hi Chuck, thanks for the info.

I did try the TypeOf method first but I seem to remember hitting a snag
(can't quite remember what it was), maybe I'll revisit that soon :o)

Keith.
www.keithwilby.com
Nov 13 '05 #4
Hi Keith,
Thanks for your great function for creating an Audit Trail. To
eliminate labels and other unwanted stuff I used the following
structure.
If ((ctl.ControlTy pe = acTextBox) Or _
(ctl.ControlTyp e = acComboBox) Or _
(ctl.ControlTyp e = acCheckBox) Or _
(ctl.ControlTyp e = acOptionGroup)) Then

Then I limited my search to the controls I was editing
strControlName = ctl.Name
If (Me(strControlN ame).Locked = False) Then

Hank Reed
Nov 13 '05 #5
ha********@aol. com (Hank Reed) wrote:
To
eliminate labels and other unwanted stuff I used the following
structure.
If ((ctl.ControlTy pe = acTextBox) Or _
(ctl.ControlTyp e = acComboBox) Or _
(ctl.ControlTyp e = acCheckBox) Or _
(ctl.ControlTyp e = acOptionGroup)) Then

Then I limited my search to the controls I was editing
strControlName = ctl.Name
If (Me(strControlN ame).Locked = False) Then


Cheers Hank, will look into that.

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
7230
by: Raphael Gluck | last post by:
Hi, Is it possible for one to program one's pages as such that when a database table is updated over the web, via a form, that an e-mail confirmation is sent to a specified address, notifying the update has taken place? If so is there a tutorial out there that is easy to understand and implement? Thanks so much
2
1900
by: Keith | last post by:
Hi I am developing an ASP application which will interact with a SQL database. A requirement of the application is that there is a full audit trail of any modifications to data. I am struggling a bit to get my head round how to do this - just the concept.
0
1469
by: Me | last post by:
Hi... A much lamented question, I guess.. I'm trying to create a simple audit trail. log the changes to an SQL 2000 table, so that they are written into a mirror table. The entire record, only the updated one, i.e. if say only one field changes, the audit table will be inserted with one record that has one field changed. if the record has been deleted, it still will be written. I'm not worrying about additional fields to the audit...
3
2737
by: Me | last post by:
Hi... A much lamented question, I guess.. I'm trying to create a simple audit trail. log the changes to an SQL 2000 table, so that they are written into a mirror table. The entire record, only the updated one, i.e. if say only one field changes, the audit table will be inserted with one record that has one field changed. if the record has been deleted, it still will be written. I'm not worrying about additional fields to the audit...
6
5847
by: Parag | last post by:
Hello, I have been assigned the task to design the audit trail for the ASP.NET web application. I don't know what the best practices for such audit trails are. Our application one dedicated user name and password to perform the database operations. I need to capture all the operations which are performed on the database. Also I need to able to capture the operations which directly performed on the backend directly using the tools like...
0
1679
by: JimLad | last post by:
Hi, I've been tasked with reviewing the Authentication and Auditing of an application and database. ASP/ASP.NET 1.1 app with SQL Server 2000 database. Separate audit trail database on same server. The system is intranet based and currently uses Basic Authentication on IIS6. The application itself is mostly classic ASP, but has been
3
3784
by: hary08 | last post by:
im doing a database for Hospital Admission, I have a log in form which prompt user for a password. The source of log in is to look for the values in my Table tblEmployees and match user name and password entered.My case now is I have Audit Trail Module which keeps records of modifications and current user, I wanted my audit trail to log the current user based on who has log from based on my Log in Form.please help ty HERES THE CODE FOR ON...
6
2742
by: babamc4 | last post by:
I have a main form (mainformlung) with 5 subforms (followupacute, followuplate, biochemresults, haemresults and pftresults). I have copied Allen Browne's Audit Trail code (thanks to Allen Browne) and this is working great, edit, insert etc is working bar when I try to delete a record in one of my subforms (I'm in test stage at the mo) I get a run time error 3022 'The changes you requested to the table where not successful because they would...
4
8161
by: Emin | last post by:
Dear Experts, We need to design a database which has an audit trail for updates to a certain set of tables. The two main approaches I've seen for this include shadow tables (an extra table to track changes to the main table) and point-in-time architectures (having an "event date" and an "as known" date for every row). Can someone suggest the pros and cons of each approach or point me to relevant literature discussing the best approach?
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10156
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.