...

View Full Version : ASP Access transaction log



dude9er
10-08-2007, 08:08 PM
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!!

BarrMan
10-08-2007, 08:14 PM
You can use FileSystemObject to create files/edit.

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

Daemonspyre
10-08-2007, 08:16 PM
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.

Have you considered looking at MySQL?

HTH!

dude9er
10-08-2007, 08:28 PM
I'm getting this error




Microsoft VBScript runtime error '800a0046'

Permission denied

/inventory/update_entry.asp, line 5

BarrMan
10-08-2007, 08:31 PM
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.

Daemonspyre
10-08-2007, 09:19 PM
This permission problem is because you need to give the IUSR_ modify access to that file.

That will solve this problem.

dude9er
10-08-2007, 09:23 PM
Where do I set this property, I have not found it within Access. Thanks for the help so far!!

BarrMan
10-08-2007, 09:30 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum