Can I pull file info from within an Access DB

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Hello, I would like to know if it is possible to pull a
files created/modified/access date from within the
database. I have a field in the database that contains a
fully qualified path & filename and I would like to run an
update query that will go out and pull the created/
modified/accessed dates from this point in time. It's
more of a one time run to load the database then keep
track of it.

Can anyone help point me in the right direction?
Thanks in advance for all your help!
 
The Date function returns the current date; the Time function returns the
current time; the Now function returns the current date and time. Queries
work against Access tables, and against properly formatted linked
information (e.g., dBase files, Excel spreadsheets, and certain text files).
If your file is an appropriate type, you can use one or some of these
functions in a Query. If it is an inappropriate text file, you can write VBA
code to open, read, and search the contents.

Larry Linson
Microsoft Access MVP
 
Hi Jeff,

I read your post differently from Larry. If I've got the right end of
the stick, just set a reference to the Microsoft Scripting Runtime
library and then do stuff like this:

Dim fso As Scripting.FileSystemObject
Dim F As Scripting.File
Dim dtCreated As Date

Set fso = New Scripting.FileSystemObject
Set F = fso.GetFile(strPathName)
dtCreated = CDate(F.DateCreated)
...
Set F = Nothing
Set fso = Nothing
 
Back
Top