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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to search for files by date programatically??

Status
Not open for further replies.

phbrady

Programmer
Oct 17, 2003
41
US
Hi,

From the O/S (windows 2000) I can right-click a folder and click search, then filter my file search by date.
I've tried to find a way to do this programatically in VB using Dir or the FileSystemObject but I see no way to do it. Am I missing something? If not, is there a third-party control that will allow me to do it? I need to find files by date in a folder conatining hundreds of thousands of files, so looking at the DateTimeStamp of each file is not a very good option.

Thanks in advance!
 
Why don't you just fill an adodb.recordset with all your file data and then use the filter property to get the records you need.

Fill it once and then you have cached data...
The recordset supports sorting,filtering and many other features you might find usefull...


just a thought

Rob
 
I've already tried that, but the problem is even though I have cached data in the db I still have to read through all the files in my vb code to update the db, and with hundreds of thousands of files it still takes too long.

Thanks for the idea, though.

 
Actually I wasn't talking about storing it in the database, I was thinking about just creating an inmemory recordset directly from the filesystem.

What are you trying to achieve?

Is dot net an option?
 
I'm not sure I understand how you might be able to filter by date, without in fact actually checking each and every date?

There's no magic performed by the Windows 2000 shell, apart from cacheing the folder entries after the first read; if you have got hundreds of thousands of files it will be slow (in NT4 folders with thousands of files used to lock explorer up)
 
Actually, strongm, it's very fast.
Without actually opening the folder, I right-click on it and click search and then fill in the date range and the search goes pretty fast.
If you actually open the folder and wait for it to load all the files, it takes forever.
This is on a Windows 2003 server.
 
I'm forced to conclude that you probably have the Indexing Service enabled on the 2003 server...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top