[dba-Tech] Windows Explorer Find replacement

MartyConnelly martyconnelly at shaw.ca
Tue Dec 13 18:05:31 CST 2005


There is a Google Desktop Plugin called AccessCrawler

http://desktop.google.ca/plugins/i/accesscrawler.html
Lots of other plugins here too.

Access Crawler Blog
http://blog.unixpoet.com/index.php?cat=16

Or roll your own

Sub testfind()
FindSub "C:\Access files\", "*mdb"
End Sub

' For this a recursive call of the routine FindSub() is used.
Sub FindSub(strStart As String, strFindWhat As String)
Dim arrFindDir() As String
Dim strFind As String
Dim i As Integer

ChDrive (Left(strStart, 3))
ChDir (strStart)

Call DirSub(strFindWhat, strStart)

strFind = Dir("*.*", vbDirectory)
i = 0

Do Until strFind = ""
ReDim Preserve arrFindDir(i)
arrFindDir(i) = strFind
i = i + 1
strFind = Dir()
Loop

For i = 0 To UBound(arrFindDir)

' If... ermittelt ob es sich um ein Verzeichnis handelt
' und verzweigt dann rekursiv in dieses Verzeichnis
If Dir(arrFindDir(i), vbNormal) = "" And Left(arrFindDir(i), 1) <> "." Then

' Rekursiver Aufruf von FindSub
Call FindSub(strStart & arrFindDir(i) & "\", strFindWhat)
ChDir (strStart)
End If
Next

End Sub


Sub DirSub(strFindWhat, strStart)

Dim strFindfile As String

strFindfile = Dir(strFindWhat, vbNormal)

Do While strFindfile <> ""
'determine Access Version Number of mdb
VersionTest strStart & strFindfile
'determine TableNames
TableFind strStart & strFindfile
strFindfile = Dir()
Loop

End Sub


Sub VersionTest(strpath As String)
'VersionTest "C:\Access files\Images\Picture2002.mdb"
On Error GoTo ErrHandler
Dim db As Database
Dim i As Long
Set db = DBEngine.OpenDatabase(strpath)
'In Version test routine should be this line to open mdb
' as shared and readonly

Set db = DBEngine.OpenDatabase(strpath, False, True)

Debug.Print strpath & " - " & db.Version & " - " & 
db.Properties("AccessVersion")
'For i = 0 To 8
' Debug.Print db.Properties(i).Name & "-" & db.Properties(i).Value
'Next
Exit Sub
ErrHandler:
' most likely 3051 read only databases
MsgBox Err.Number & " - " & Err.Description & vbCrLf & strpath
End Sub

Sub TableFind(strpath As String)
'VersionTest "C:\Access files\Images\Picture2002.mdb"
On Error GoTo ErrHandler
Dim db As Database
Dim tdfCurrent As DAO.TableDef
Dim i As Long
Set db = DBEngine.OpenDatabase(strpath)
'In Version test routine should be this line to open mdb
' as shared and readonly

Set db = DBEngine.OpenDatabase(strpath, False, True)
For Each tdfCurrent In db.TableDefs
Debug.Print tdfCurrent.Name
Next
Exit Sub
ErrHandler:
' most likely 3051 read only databases
MsgBox Err.Number & " - " & Err.Description & vbCrLf & strpath
End Sub


Arthur Fuller wrote:

>I just wish it would search Access files! I want to know which of 200 MDB
>files contains the table XYZ, and apparently I have no choice but to open
>each one. This ought not be difficult but apparently it is. Why, I do not
>know. Maybe there is a solution to this problem, ideally generic enough to
>also inspect MS-SQL MDF files too. And the MySQL databases too. I would like
>to target all the databases of a certain type and locate a column XYZ within
>them. That would be nice. 
>I create a lot of documents to be sure, but that is not where the really
>important stuff lives. Yeah, I am a database geek, but so what, does that
>mean I am chopped liver?
>Incidentally, I almost never use PowerPoint but do the search things find
>text therein? And what about Excel files? And for that matter, what about
>text strings in executables?
>A.
>-----Original Message-----
>From: dba-tech-bounces at databaseadvisors.com
>[mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Josh McFarlane
>Sent: December 8, 2005 2:32 PM
>To: Discussion of Hardware and Software issues
>Subject: Re: [dba-Tech] Windows Explorer Find replacement
>
>On 12/8/05, MartyConnelly <martyconnelly at shaw.ca> wrote:
>  
>
>>I use Google's Desktop Search Engine. It takes about 12 hours to index a
>>full 20 gig drive.
>>Once done, searches are generally less than 5 seconds.
>>It only indexes to a depth of 5000 characters in a file unless
>>additional plugins used
>>You can search in only specific files by adding to the search string
>>filetype:doc to look at only word documents.
>>A plus is it also searchs your IE favourite URL's and whatever is in the
>>IE cache.
>>
>>I have used the find function only a couple of times in past year.
>>    
>>
>
>I personally love it when I need to search text based documents.
>
>I have google search on my development machine, and it's pretty
>accurate when I need to dig up a 3rd-party header file or such that I
>remember downloading at one time, but forgot where I put it.
>
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the dba-Tech mailing list