Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Modified 1

Status
Not open for further replies.

JohannIcon

Programmer
Sep 3, 2002
440
0
0
MT
Dear All,

I am trying to implement a function where the user will know when he last did amendments on the database. One way that came up in my mind was to include a function after the user presses the submit button. Is there an easier way to get the date of the last modification of the database?

Thanks for your help and time
 
Maybe a bit basic but if there's no other way, you could have an extra field in the userDetails table so that each time they modify the database, the current date is written to this new field. Then just read it back the next time the user accesses the database.

Hope this helps

Millzy
 
Yeah that is what I though in the first place, ie when the user presses the submit button (ie changing data) a date is written in a field.

However I thought that there was something simpler to get the date that the database was last modified or something of the sort.
 
There could be, there probably is, but I dont know it. Sorry
 
First of all: which database are you using?
Second: do you want to know
- the last change date/time of the database/table?
- the last change date/time the user made a change to the database/table?
- the last change date/time of a record in the table?

and: i can think of situations where hitting the submit button will not result in changing data.

In MS SQL i do these type of things with a trigger in the database. I do not have to worry which program is changing the data: the trigger handles any actual update.

hth,
Foxbox
ttmug.gif
 
Hello foxbox

I am using an MS Access database.

What I want to know is
- the last change date/time the user made a change to the database/table.

So how do you go about and setting up a trigger? Can you give me more info please

Thanks for your help and time
 
You cant setup a trigger but you can use FSO to get what you need. Since the system knws when the file was last modified/edited.
Code:
   path=Server.MapPath("mydatabase.mdb")
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFile(path)
   datecreated=f.DateCreated
   lastaccess=f.DateLastAccessed
For more information about the File object (f it's file object) check link


________
George, M
 
Thanks Shaddow,

I will surely give it a try!

Thanks again
 
Maybe the free component "LastMod"
is usefull for you.

If more than 1 user is changing a database and you want to tell each user when he/she made the last update you need to create an extra table:

userid
tablename
lastupdate

Each regular update to a table should be followed by an update to this log.



















hth,
Foxbox
ttmug.gif
 
Ok I tried Shaddow's code and it worked perfectly, thanks Shaddow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top