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!

Getting the date that the database was last modified

Status
Not open for further replies.

jlindquist

Programmer
Jun 8, 2001
14
0
0
US
I have an about box where I put the version number, creator, and the date it was last updated. Is there any way to retrieve the date that the database was last modified through code or retrieving the database properties?
 
Just one solution...

You probably have a table containing your version number and creator. Just add a field 'LastChanged' as a date and use sql to update the field before all form updates. You would need to insert the following in the BeforeUpdate event of all forms.

Steve King


Dim strSQL As String

strSQL = "UPDATE tblAbout " _
& "SET LastChanged = #" & Date & "#;"
DoCmd.RunSQL(strSQL)


Growth follows a healthy professional curiosity
 
You can use FileSystemObject, just ensure you have added the Microsoft Scripting Runtime library to your references.

Function GetLastModified(strFile As String) As String
Dim fso As New FileSystemObject
If fso.FileExists(strFile) Then
GetLastModified = fso.GetFile(strFile).DateLastModified
MsgBox GetLastModified
Else
MsgBox "File Doesn't Exist"
End If
End Function

PaulF
 
The only problem with this is that even if it was just a change in some data in a table, the time stamp for the .MDB changes. Thus, your last modified date would be every time the application is used. If this is what you want, then do it. Otherwise, I agree with the static table with the data in it. Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top