[AccessD] A2003: Get Latest File in a folder

Darren D darren at activebilling.com.au
Sun Dec 9 22:29:03 CST 2007


Hi Team

 

I need to determine the file name of the 'last' file in a given folder

In this instance I need to use define the 'last' file in a folder by the
date/time

 

EG In a folder I may have 3 files

123XYZA012820071205

123XYZA012920071205

123XYZA013020071205

 

Where 123XYZA013020071205 is the 'latest' file in the folder by say.a few hours 

Though the time diff is not important - just so long as I can tell it is the
most recent file

 

I appreciate the files have date stamps in their file name - this is not
suitable - I need the latest by date and time

I also can see the files have sequential numbers 128,129 and 130 in the 3 I have
provided 

This is the issue though I am trying to determine If the highest sequential no
= the latest file 

This is to avoid loosing sequence etc with our suppliers

 

Any pointers/suggestions?

 

I assume I will be using the FSO object - I am familiar with that 

I also know it has the ability to interrogate the date/time attribs of files 

Though I am not sure how to loop through all the files in a folder and determine
the newest one - that's the bit I am clueless on 

(Andy - No comments about how clueless I am in general :-) )

 

NB: these files do not have extensions - So that can't be part of any suggested
solution 

 

Many thanks in advance

 

Darren

 

 

 

 




More information about the AccessD mailing list