[windows2000] Re: Finding Access 97 databases

  • From: "Ray at work" <listray@xxxxxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Thu, 4 Nov 2004 19:30:02 -0500

Hi Cristoph,
You can use DAO to determine the Access version.  3.0 = 97.  4.0 = 2000.  I
~believe~ that 2002 and 2003 will also be returned as 4.0, as they all use
the same file format.  Try this script.  It successfully generated a CSV
file for me.  Just change the values of PATH_ROOT and LOG_FILE to what
directory you want to search in and what file path the the results should be
written to, respectively.  If you use a drive letter as your PATH_ROOT,
include the \ as I have done here.
Option Explicit
Const PATH_ROOT = "C:\"
Const LOG_FILE = "C:\AccessVersions.csv"

Dim oFSO, oLogFile

Call Main()

Sub Main()
        Set oFSO = CreateObject("Scripting.FileSystemObject")
        Set oLogFile = oFSO.OpenTextFile(LOG_FILE, 8, True)
        Call MDBSearch(PATH_ROOT)
        oLogFile.Close : Set oLogFile = Nothing
        Set oFSO = Nothing
        WScript.Echo "Finished"
End Sub

Sub MDBSearch(Pathroot)
        Dim oDir, oSubdir, oFile
        Set oDir = oFSO.GetFolder(Pathroot)
        For Each oSubdir in oDir.SubFolders
                Call MDBSearch(oSubdir.Path)
        For Each oFile in oDir.Files
                If LCase(oFSO.GetExtensionName(oFile.Path)) = "mdb" Then
Call LogIt(oFile.Path, AccessVersion(oFile.Path))
End Sub

Sub Logit(Filepath, Version)
        oLogFile.WriteLine(Filepath & "," & Version)
End Sub

Function AccessVersion(Filepath)
        Dim oDAO, oDB
        Set oDAO = CreateObject("DAO.DBEngine.36")
        Set oDB = oDAO.OpenDatabase(Filepath)
        AccessVersion = oDB.Version
        Set oDB = Nothing
End Function


        From: windows2000-bounce@xxxxxxxxxxxxx
[mailto:windows2000-bounce@xxxxxxxxxxxxx] On Behalf Of Puetz, Christoph (TH
        Sent: Thursday, November 04, 2004 5:04 PM
        To: windows2000@xxxxxxxxxxxxx
        Subject: [windows2000] Finding Access 97 databases
        Hi guys,
        We have been asked to identify all MS Access 97 databases on the
SAN. Well, finding all Access databases is not a big deal. But is there a
way to find out what version they are - script-wise?

This Weeks Sponsor StressedPuppy.com Games
Feeling stressed out? Check out our games to
relieve your stress.
To Unsubscribe, set digest or vacation
mode or view archives use the below link.


Other related posts: