Link to home
Start Free TrialLog in
Avatar of darbid73
darbid73Flag for Germany

asked on

How to use ADO and Windows Desktop Search with VBA

I found this thread here with an example

https://www.experts-exchange.com/questions/23483221/Windows-Search-A-word-or-ohrase-in-the-file-API-Search-in-for-a-string-in-a-file.html

I have put another example below.  This is not my code just an example.

Upon trying to open the connection I get "Provider Cannot be Found. It may not be properly Installed"

I would like to be able to run this from MS Access 2003.
Dim con As ADODB.Connection
Dim rst As ADODB.Recordset

Set con = New ADODB.Connection
Set rst = New ADODB.Recordset

Dim sConString As String
Dim sSQLString As String

sConString = "Provider=Search.CollatorDSO;Extended Properties='Application=Windows';"
con.Open sConString

sSQLString = "SELECT Top 5 System.ItemPathDisplay FROM SYSTEMINDEX"

Set rst = con.Execute(sSQLString)

Do Until (rst.EOF)
   Debug.Print rst.Fields.Item("System.ItemPathDisplay").Value
   rst.MoveNext
Loop

rst.Close
Set rst = Nothing

con.Close
Set con = Nothing

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of nffvrxqgrcfqvvc
nffvrxqgrcfqvvc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of darbid73

ASKER

Ahh its a version propblem.

I am on a work computer with admins somewhere pushing updates to us.  Our WDS is only  02.06.5000.5378.  Does ot surprise me that we have a version from 2006 - http://technet.microsoft.com/en-us/library/cc771683%28WS.10%29.aspx

I suppose that I cannot download the provider without getting the whole thing? Probably be not compatible anyway.