Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: Audit Log???

  1. #1
    Join Date
    Aug 2006
    Posts
    559

    Unanswered: Audit Log???

    I'm trying to see if there is a really easy way to create an audit log for a db? Like to record each action taken by users (updating, editing, printing, opening, closing, etc).

    I had this in an old db that I made but I don't remember what it does and can't figure it out:

    DoCmd.RunSQL "INSERT INTO Audit (UserID, Action) VALUES ('" & pstrUserName & "', 'Record Update: " & strDocID & "');"

    **It was placed on every from on the "on open" event**

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Yes.... in SQL Server and similar enterprise level systems. A bit of a problem in Access. Although your code is just logging form usage so that is fine.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Aug 2006
    Posts
    559
    Quote Originally Posted by pootle flump
    Yes.... in SQL Server and similar enterprise level systems. A bit of a problem in Access. Although your code is just logging form usage so that is fine.

    So I guess I can do some thing like this in the "on open" event of each form?:::

    DoCmd.RunSQL "INSERT INTO Audit (User_Name, Action) VALUES ('" & fOSUserName & "', 'Record Update: " & Task_ID & "');"

    **But I am thinking that is only for when people update or open a new record?

    I am trying to capture everything that they do. IE: editing or adding to fields, opening forms, searching. Some thing like a key-logger.....

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Grafixx01
    I am trying to capture everything that they do. IE: editing or adding to fields, opening forms, searching. Some thing like a key-logger.....
    That's where it gets trickier. Never even attempted to do it in Access. JET is just not well suited to this. Someone will pop up. Until then try blackling:
    "audit log" access
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Aug 2006
    Posts
    559
    Ok, I figure it'd be extremely hard to do, capturing every key hit. But I am really just trying to capture their actions. Like what they did, (open, edit, close, login, logout).

    Or do you think it's even necessary since the db is only really for tracking documents and works fine for that?

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Grafixx01
    Or do you think it's even necessary since the db is only really for tracking documents and works fine for that?
    I cannot possibly answer that - that must be driven by your business requirements not people on a board who have no real understanding of your needs (nor, for that matter, any responsibility or accountability for them either).

    Quote Originally Posted by Grafixx01
    Ok, I figure it'd be extremely hard to do, capturing every key hit. But I am really just trying to capture their actions. Like what they did, (open, edit, close, login, logout).
    Basically the ideal here is to use event handlers and you want these handlers as close to the data as possible. In other RDBMSs a table event handler is called a Trigger and is perfect for audit logging. There is no such thing in Access. All you can do is put code into the afterupdate, afterinsert, afterdelete events for your forms. However, you can not catch updates run via a query, someone getting into the database window and editing data directly in tables etc. Only changes made via your forms can be captured.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Aug 2006
    Posts
    559
    All I'm trying to do is capture everything done via forms. But I am debating if it's even worth doing? i know in my other db that I had, I never even looked at the audit log and it's only for tracking documents that are submitted to the command section for action. That's why I'm debating it since it'll eliminate a bunch of programming and probably more issues than I have already been experiencing.

  8. #8
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    "If there is ever any doubt... there is no doubt".

    Well - as I said you should not take the advice of someone off a forum but... if I were you I would drop the idea and concentrate on more important stuff like making your splash screen fade out when your application loads
    Testimonial:
    pootle flump
    ur codings are working excelent.

  9. #9
    Join Date
    Aug 2006
    Posts
    559
    Quote Originally Posted by pootle flump
    "If there is ever any doubt... there is no doubt".

    Well - as I said you should not take the advice of someone off a forum but... if I were you I would drop the idea and concentrate on more important stuff like making your splash screen fade out when your application loads

    That'd actually be a neat thing to do. I have it already opening the new form after a 4000 timer / 5000 timer.

    I also want to make it minimize the MS Access window so that only the forms are displayable to the user but all of the generic MS Access windows (File Menu, etc) cannot be accessed unless they bypass security with the "Shift" key.

  10. #10
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Grafixx01
    That'd actually be a neat thing to do. I have it already opening the new form after a 4000 timer / 5000 timer.
    Glad you are a bit more adventurous than the others on this forum

    Quote Originally Posted by Grafixx01
    I also want to make it minimize the MS Access window so that only the forms are displayable to the user but all of the generic MS Access windows (File Menu, etc) cannot be accessed unless they bypass security with the "Shift" key.
    Check out Paul's second (I think second) entry in the code bank. It is about the simplest method I have seen for doing this. You can, of course, go as complicated as you like with custom menus and API functions but Paul's method gives great bang for your buck.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  11. #11
    Join Date
    Aug 2006
    Posts
    559
    Quote Originally Posted by pootle flump
    Glad you are a bit more adventurous than the others on this forum

    Check out Paul's second (I think second) entry in the code bank. It is about the simplest method I have seen for doing this. You can, of course, go as complicated as you like with custom menus and API functions but Paul's method gives great bang for your buck.

    Thanks! I appreciate that compliment, I guess it's a compliment. I am going to check out his link.

    On a side note, I actually got told by the database administrator for the U.S. Army base I work on that I'm creating a much nicer and more complex database than they've ever done! I've even asked them some of the questions that I've had and they have no clue. Now they're starting trouble with me and my job so i think they are afraid I'll take their job.

  12. #12
    Join Date
    Aug 2006
    Posts
    559
    Quote Originally Posted by pootle flump
    Check out Paul's second (I think second) entry in the code bank. It is about the simplest method I have seen for doing this. You can, of course, go as complicated as you like with custom menus and API functions but Paul's method gives great bang for your buck.
    pootle,

    I tried to see if there was anything there to do this, I didn't find it. I may be blind though.

  13. #13
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by Poots
    if I were you I would drop the idea and concentrate on more important stuff like making your splash screen fade out when your application loads
    Shouldn't that be wrapped in sarcasm tags?
    Quote Originally Posted by Poots
    Glad you are a bit more adventurous than the others on this forum
    *ahem* ->> http://www.dbforums.com/showpost.php...75&postcount=7
    George
    Home | Blog

  14. #14
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    Shouldn't that be wrapped in sarcasm tags?
    Humour tags maybe.

    Grafixx01 - just so you know you aren't the butt of a joke or anything I was just baiting a hook for some of these guys here:
    http://www.dbforums.com/showthread.php?t=1618806

    One of them bit



    I have not looked in real detail at Paul's solution (or at least not that part) however I strongly suspect that the upper most form is launched in "modal" mode. I don't think there is any code wizadary going on.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  15. #15
    Join Date
    Aug 2006
    Posts
    559
    Ah...You know what .... After reading that thread, yeah, NO! I was thinking about like a little tune or some thing during the loading of the db (splash screen) but I think I'm not going to do that now.

    I believe so far, that I'm doing well with what I have. I just want a few more tweaks done and possibly look into adding more to it at a later date.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •