Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Aug 2004
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP Access transaction log

    I have an access database for a hotel room list which includes how many rooms I have available for each hotel. This list is updated via a form that updates the database, either adding or removing rooms. The database is on the server and is accessible by four employees, each of whom can update the hotel room number as they sell them.

    The hotel rooms are in a table and this table is updated and records who updated it last by overwriting the previous update entry. I want to create a log file that records ALL updates each time the form is submitted, so I can track all transactions. I have not found any info on how this is done. Do I need to create a secondary table that only records when the form is submitted and database is updated? How do I do this?

    Thanks on advance!!

  • #2
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    You can use FileSystemObject to create files/edit.
    Code:
    Dim Fso
    Set Fso = Server.CreateObject("Scripting.FileSystemObject")
    Dim LogFile
    Set LogFile = Fso.CreateTextFile(Server.MapPath("."),8,true) 'Creates a text file on the same folder.
    LogFile.WriteLine("[" & Now() & "] Transaction number: " & ID & ", More information")
    Set Fso = Nothing
    Set LogFile = Nothing

  • #3
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Access does not have any transaction logging as you require.

    You are going to need to do what you have already suggested, building a second table use for auditing.

    Then, inside your code, you will need to set up a function that writes the required information to the Access "Auditor" table as necessary.

    Hate to tell you that, but it's one of the [many] limitations that Access has, being a glorified Excel, rather than an ANSI SQL database system.

    [plug] Have you considered looking at MySQL? [/plug]

    HTH!
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #4
    New Coder
    Join Date
    Aug 2004
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm getting this error

    Code:
    Microsoft VBScript runtime  error '800a0046'
    
    Permission denied
    
    /inventory/update_entry.asp, line 5

  • #5
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    When trying to run my code? Then it's obvious you have an access problem. You should go to the file's security options and check the permissions you need.

  • #6
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    This permission problem is because you need to give the IUSR_ modify access to that file.

    That will solve this problem.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #7
    New Coder
    Join Date
    Aug 2004
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Where do I set this property, I have not found it within Access. Thanks for the help so far!!

  • #8
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    View the folder you'd like to access.
    Right click on it -> Properties.
    On the tab Security you have the Groups or username's.
    There you select the user you're using and below you have the permissions that user has.


  •  

    Posting Permissions

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