Can you get file properties through .bat file?

option

Registered User.
Local time
Today, 10:50
Joined
Jul 3, 2008
Messages
143
Hey guys,

I'm trying to write a batch file that will take a list of databases I have and check what version of access they are made for. Once that is determined, I would need that information in either a spreadsheet or a text file with some sort of delimiter. Reason being: we have been building databases for many years, and some of them were built in Acc97. We're getting ready to convert all workstations to Acc2003, and we're just trying to check the magnitude of impact that this may have. Now, this doesn't necessarily have to be a batch file either, since I already have the list of databases in a spreadsheet. I could also use VBA as well, but I don;t know where to begin!:confused: Any help would be greatly appreciated!
 
Hi,
I've no idea how to do it in a batch file but this will work in VBA. Obviously there is no error checking whatsoever here!
Code:
Public Function FileVersion(sPathFile As String) As String
Dim appAccess As Access.Application

Set appAccess = New Access.Application

appAccess.OpenCurrentDatabase sPathFile

'this bit comes straight from FileFormat Help
Select Case appAccess.CurrentProject.FileFormat
    Case acFileFormatAccess2
        FileVersion = "Microsoft Access 2"
    Case acFileFormatAccess95
        FileVersion = "Microsoft Access 95"
    Case acFileFormatAccess97
        FileVersion = "Microsoft Access 97"
    Case acFileFormatAccess2000
        FileVersion = "Microsoft Access 2000"
    Case acFileFormatAccess2002
        FileVersion = "Access 2002 - 2003"
End Select

appAccess.CloseCurrentDatabase
Set appAccess = Nothing

End Function

Chris
 
That's great! One quick question: Is there a way to modify this so that the actual databases in my record set don't have to open? Alot of them have autoexec macros in them, and if I try to status all of my databases (450+) this could not only duplicate data, but also be very time consuming. Thanks for this btw!!
 
That works perfectly! Thanks a million!!!!
 

Users who are viewing this thread

Back
Top Bottom