G
Guest
I am trying to create a routine to gather information about files. I found
the following code provided by the MS Scripting Guy:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=Search.CollatorDSO;Extended
Properties='Application=Windows';"
'objRecordset.Open "SELECT System.FileName, System.Photo.DateTaken FROM
SYSTEMINDEX " & _
' "Where System.ItemFolderPathDisplay = 'C:\Europe' and
System.FileExtension = '.jpg'", _
' objConnection
Set fs = CreateObject("Scripting.FileSystemObject")
objRecordset.MoveFirst
‘Loop to gather file data…
‘
It works for folders and files on the C: drive. However, I have additional
drives and if I change the location from ‘C:\Europe’ to another drive (such
as ‘H:\Europe’) then I get an error 3021 in the line: objRecordset.MoveFirst
Why the error and how do I change the code do handle other drives?
Thanks,
David
the following code provided by the MS Scripting Guy:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=Search.CollatorDSO;Extended
Properties='Application=Windows';"
'objRecordset.Open "SELECT System.FileName, System.Photo.DateTaken FROM
SYSTEMINDEX " & _
' "Where System.ItemFolderPathDisplay = 'C:\Europe' and
System.FileExtension = '.jpg'", _
' objConnection
Set fs = CreateObject("Scripting.FileSystemObject")
objRecordset.MoveFirst
‘Loop to gather file data…
‘
It works for folders and files on the C: drive. However, I have additional
drives and if I change the location from ‘C:\Europe’ to another drive (such
as ‘H:\Europe’) then I get an error 3021 in the line: objRecordset.MoveFirst
Why the error and how do I change the code do handle other drives?
Thanks,
David