File Properties

  • Thread starter Thread starter Dwight
  • Start date Start date
D

Dwight

Is there a way to get the properties of a file using
code. I need to compare the created dates of 2 files to
determine which one is older, then replace the first file
if it is older then the second file.


Thanks in advance!

Dwight
 
Dwight said:
Is there a way to get the properties of a file using
code. I need to compare the created dates of 2 files to
determine which one is older, then replace the first file
if it is older then the second file.


Thanks in advance!

Dwight

I believe the function's name is FileDateTime. Look for it in the
online help in the VB Editor.
 
The FileDateTime function returns the modified date. I
need to have compare the Date Created. Does anyone know
how to get the Date Created?
 
Dwight said:
The FileDateTime function returns the modified date. I
need to have compare the Date Created. Does anyone know
how to get the Date Created?

Ah, I understand now. Apparently Doug Steele does. :-)
 
The FSO works great. You can get created, modified, and accessed date/time.

That's what I use at the bottom of my web site pages like http://www.scobiz.com/Calendar.asp and
http://www.scobiz.com/Presentations.asp.

You need to set a reference to "Microsoft Scripting Runtime" in VBA or use late binding.

For time's sake, I just copied the VBScript from my ASP. (It uses late binding.) You shouldn't have any problem cleaning it up for
VBA.

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.GetFile(Server.MapPath("Presentations.asp"))
datDateCreatedASP = objFile.DateCreated
datDateLastModifiedASP = objFile.DateLastModified
datDateLastAccessedASP = objFile.DateLastAccessed

Good luck.

--

Sco

M.L. "Sco" Scofield, MCSD, MCP, MSS, Access MVP, A+
Useful Metric Conversion #16 of 19: 2 monograms = 1 diagram
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
Back
Top