UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Is It Possible To Search My Computer For Files Using Access, Access 2016    
 
   
InfoHound
post Dec 3 2016, 07:27 PM
Post#1



Posts: 1,057
Joined: 1-December 12



Is it possible to create a search engine to look for files on my computer.

I know this may seem redundant to what MS already offers, but, I think it would be fun to built.

Pointing me to any good websites would be great.

Thans
Go to the top of the page
 
GroverParkGeorge
post Dec 3 2016, 08:57 PM
Post#2


UA Admin
Posts: 31,234
Joined: 20-June 02
From: Newcastle, WA


The short answer is yes, you can write VBA to search any folder structure using the File Scripting Object. Set a reference to the Microsoft Scripting Runtime.

You can create a recursive search that will find whatever you tell it to find.

However, I don't have any specific example code handy. Look in our code archives here.
Attached File(s)
Attached File  2016_12_03_17_53_32.jpg ( 79.49K )Number of downloads: 1
 

--------------------
Go to the top of the page
 
InfoHound
post Dec 3 2016, 10:51 PM
Post#3



Posts: 1,057
Joined: 1-December 12



Will do. Thank you very much Grover
Go to the top of the page
 
Doug Steele
post Dec 3 2016, 10:53 PM
Post#4


UtterAccess VIP
Posts: 21,497
Joined: 8-January 07
From: St. Catharines, ON (Canada)


<picky>No need to set a reference to File Scripting Object. It works just fine with Late Binding.</picky>

--------------------
Go to the top of the page
 
GroverParkGeorge
post Dec 3 2016, 10:56 PM
Post#5


UA Admin
Posts: 31,234
Joined: 20-June 02
From: Newcastle, WA


Of course. But you might want to start with it set to get Intellisense while working out the method.

--------------------
Go to the top of the page
 
GlenKruger
post Dec 4 2016, 01:35 AM
Post#6


Utterly Crispy UA Forum Administrator
Posts: 8,766
Joined: 29-September 01
From: Edmonton,Alberta,Canada


It is possible but I recently tried using it to find all the databases files on a hard drive using a recursive search, Allen Browne has a good example of how to do it. The thing was I found it to slow. Access does not have the ability for multi threading so I found a C# program called File Searcher which has the ability after finding the files to write the results to a text file which can then be imported to a table in an access database which is what I needed. I then wrote code to either copy or move them to a hard drive I wanted to back them up to. I took it one step farther and found a program called Search My Files which has the capability to search for duplicates which comes in handy when I was backing up my MP3's I would first find and remove the duplicates and then search again and write to text file then import to table then back them up either copying them or moving them. I would then delete all entries from table upon closing the database. Since I had multiple copies of the files I needed to remove from a hard drive it worked fairly well.

--------------------
Human nature, it is a funny thing and the hardest thing to program to prevent.
Glen Kruger KNKConsulting
MS Access MVP 2013-2018| Wrox Techincal Contributor
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    15th December 2017 - 10:11 PM