The easiest way to do this from the perspective of recording the information
would be to use triggers. Set them up for the tables that you want to track
and then you don't need to do anything with your queries. Just create
triggers for INSERT and UPDATE (one trigger for both) and have the trigger
update a separate table that contains the name of the table changed, and the
last modified date (which you can get using GETDATE() (in SQL Server)).
Then it doesn't matter what apps you write, the database will always keep
itself up to date.
Bob
-----Original Message-----
From: Bernd VanSkiver [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 18, 2001 9:33 AM
To: CF-Talk
Subject: RE: last updated
Ya, could be fairly simple if it was an Access database, but it is SQL.
Guess I'm going to have to just stick a column in a table and have the
update queries modify that date whenever they make a change to the db. Was
just hoping for an easy automatic way.
Bernd VanSkiver
[EMAIL PROTECTED]
ColdFusion Developer
ICQ #: 916324
----Original Message Follows----
From: "Bob Silverberg" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: CF-Talk <[EMAIL PROTECTED]>
Subject: RE: last updated
Date: Sun, 18 Mar 2001 09:04:16 -0500
If you're talking about an Access database, and all you want is the last
date modified for the mdb file, use the CFDIRECTORY tag. It can read a
directory and return info on files in that directory. If you only have one
mdb file in the directory you can use the filter= attribute so that you
don't have to loop through the query to find the right record.
Here's an example:
<cfdirectory action="LIST" directory="C:\MyDirectory" name="qryDir"
filter="*.mdb">
<cfoutput>
#qryDir.DateLastModified#
</cfoutput>
If you can't be sure of returning only one record, you can change it to:
<cfoutput>
<cfif qryDir.Name EQ "Mydb.mdb">
#qryDir.DateLastModified#
</cfif>
</cfoutput>
Of course, you could parameterize the file name - heck, you could even make
it into a pretty simple custom tag!
Bob
-----Original Message-----
From: Bernd VanSkiver [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 17, 2001 11:49 PM
To: CF-Talk
Subject: last updated
Is there a way for cf to see when a certain database was last modified?
Wanting to show last updated date to site content and product information on
front page and think being able to see when the database was last modified
would be the easiest way to do it.
Bernd VanSkiver
[EMAIL PROTECTED]
ColdFusion Developer
ICQ #: 916324
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists