Re: Audit Trail Problem
- From: "KatK" <KatK@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 12 Aug 2005 06:58:02 -0700
Thanks for your reply. How can I go about doing this? Do you have any
resources you recommend I read to get me started?
I'm guessing since you suggested SQL Sever tables, this is the best
direction to go. However, is there another route to get the new and original
number values from a form passed to the audit trail table? Below is the code
I'm using to get the user type, user id, table changed, and time changed
inserted into the audit table. As I mentioned before, I tried using
ctl.oldvalue & ctl.value properties but couldn't get them to work. Thanks
for all your help!
**********************************
Public Function AuditTrail(FormName As String)
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("tblAuditTrail")
With rst
.AddNew
.Fields("User") = UserID
.Fields("UserType") = UserType
.Fields("TimeChanged") = Now()
.Fields("TableChanged") = Form_MainMenu.cb_TableSelection
.Update
End With
ExitPoint:
On Error Resume Next
rst.Close
Set rst = Nothing
Set dbs = Nothing
End Function
*************************************
"Allen Browne" wrote:
> KatK, have you considered using SQL Sever tables instead of JET tables?
>
> You can still use the Access interface (well, it will need modifications),
> but use the SQL Server engine to provide transaction logs, or use triggers
> to generate just the details you want.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "KatK" <KatK@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:D563C765-0C63-4414-8B5C-C6D8DF467F69@xxxxxxxxxxxxxxxx
> >I need to create an audit trail for my database. I have referred to Allen
> > Browne's audit trail and read all posts regarding audit trails. However,
> > my
> > database has 200+ tables and forms; therefore, Allen Browne's audit trail
> > example is not logical for me to use since I would have to create two
> > tables
> > for each table I already have (please correct me if I am wrong).
> >
> > For my database I have gotten part of my audit trail to work correctly.
> > My
> > username, time changed, table changed, and user type are working
> > correctly;
> > however, I can not get the previous value and new value to work. I have
> > tried using the OldValue and Value properties, but I can't get them to be
> > entered into my audit table.
> >
> > Any help would be wonderful! Thanks in advance!
>
>
>
.
- Follow-Ups:
- Re: Audit Trail Problem
- From: Allen Browne
- Re: Audit Trail Problem
- References:
- Audit Trail Problem
- From: KatK
- Re: Audit Trail Problem
- From: Allen Browne
- Audit Trail Problem
- Prev by Date: Re: How do I set up openrecordset with the table as a variable?
- Next by Date: Passing Criteria to SQL Statement
- Previous by thread: Re: Audit Trail Problem
- Next by thread: Re: Audit Trail Problem
- Index(es):
Relevant Pages
|