Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-08-2007, 07:08 PM   PM User | #1
dude9er
New Coder

 
Join Date: Aug 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
dude9er is an unknown quantity at this point
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!!
dude9er is offline   Reply With Quote
Old 10-08-2007, 07:14 PM   PM User | #2
BarrMan
Senior Coder

 
BarrMan's Avatar
 
Join Date: Feb 2005
Location: Israel.
Posts: 1,644
Thanks: 69
Thanked 83 Times in 82 Posts
BarrMan is on a distinguished road
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
BarrMan is offline   Reply With Quote
Old 10-08-2007, 07:16 PM   PM User | #3
Daemonspyre
Regular Coder

 
Join Date: Mar 2007
Posts: 505
Thanks: 1
Thanked 19 Times in 19 Posts
Daemonspyre is on a distinguished road
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!
__________________
Quote:
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.
Daemonspyre is offline   Reply With Quote
Old 10-08-2007, 07:28 PM   PM User | #4
dude9er
New Coder

 
Join Date: Aug 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
dude9er is an unknown quantity at this point
I'm getting this error

Code:
Microsoft VBScript runtime  error '800a0046'

Permission denied

/inventory/update_entry.asp, line 5
dude9er is offline   Reply With Quote
Old 10-08-2007, 07:31 PM   PM User | #5
BarrMan
Senior Coder

 
BarrMan's Avatar
 
Join Date: Feb 2005
Location: Israel.
Posts: 1,644
Thanks: 69
Thanked 83 Times in 82 Posts
BarrMan is on a distinguished road
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.
BarrMan is offline   Reply With Quote
Old 10-08-2007, 08:19 PM   PM User | #6
Daemonspyre
Regular Coder

 
Join Date: Mar 2007
Posts: 505
Thanks: 1
Thanked 19 Times in 19 Posts
Daemonspyre is on a distinguished road
This permission problem is because you need to give the IUSR_ modify access to that file.

That will solve this problem.
__________________
Quote:
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.
Daemonspyre is offline   Reply With Quote
Old 10-08-2007, 08:23 PM   PM User | #7
dude9er
New Coder

 
Join Date: Aug 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
dude9er is an unknown quantity at this point
Where do I set this property, I have not found it within Access. Thanks for the help so far!!
dude9er is offline   Reply With Quote
Old 10-08-2007, 08:30 PM   PM User | #8
BarrMan
Senior Coder

 
BarrMan's Avatar
 
Join Date: Feb 2005
Location: Israel.
Posts: 1,644
Thanks: 69
Thanked 83 Times in 82 Posts
BarrMan is on a distinguished road
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.
BarrMan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:46 AM.


Advertisement
Log in to turn off these ads.