How to find Access version with code

J

Jerry C

Is the current MS Access version somewhere in the
register?
How can I determine the MS Access (MSAccess.exe) version
with code?
 
A

Arvin Meyer

Jerry C said:
Is the current MS Access version somewhere in the
register?
How can I determine the MS Access (MSAccess.exe) version
with code?

This will work for any MDB. strDB is the full path to the database. It will
crash the database it is running in if the path is incorrectly entered, so
be careful.

Function GetAccessVer(strDB As String)
On Error GoTo Err_handler

Dim ws As DAO.Workspace
Dim db As DAO.Database

Set ws = CreateWorkspace("TempWorkSpace", "Admin", "", dbUseJet)
Set db = ws.OpenDatabase(strDB)

Debug.Print strDB, db.Properties("AccessVersion")

Exit_Here:
db.Close
Set db = Nothing
ws.Close
Set ws = Nothing
DoEvents
Exit Function

Err_handler:
Resume Exit_Here
End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top