Date mdb was created

S

Steven

Is there a way to return when a mdb file was created?

Like CurrentDb.Name will return the Name of the file.

What is the command the will return the date and time the
file was created?

Thank you,

Steven
 
J

Jay Vinton

Is there a way to return when a mdb file was created?

Hi Steven,

To get the create/modify info for the MDB, click Tools -> References and add a reference to the Microsoft Scripting Runtime. Then:

Dim fso As Scripting.FileSystemObject
Dim fil As Scripting.File

Set fso = New Scripting.FileSystemObject
Set fil = fso.GetFile(CurrentDB.Name)

Debug.Print fil.DateCreated, fil.DateLastAccessed, fil.DateLastModified

Set fil = Nothing
Set fso = Nothing


To get similar info on tables

Debug.Print CurrentDB.TableDefs("tablename").DateCreated (and .LastModified)


Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top