determining jet version

norm

Registered User.
Local time
Today, 02:59
Joined
Sep 20, 2000
Messages
62
Anyone know how to determine the jet version currently installed?
 
This will tell you the version of Access the db is using...

Public Function AccessVersion() As String
AccessVersion = SysCmd(acSysCmdAccessVer)
MsgBox "This db is using version " & AccessVersion & " of Access."
End Function

Look up the help files in Access for Version Property to see which versions of jet are used for each version of Access.

HTH
 
Slighly modified from the help files example for Version Property...

Code:
Option Compare Database
Option Explicit

'This example uses the Version property to report on the Microsoft Jet database
'engine in memory, a Microsoft Jet database, and an ODBC connection.

Public Sub VersionX()

    Dim wrkJet As Workspace
    Dim dbsDB As Database
    Dim wrkODBC As Workspace
    Dim conPubs As Connection

    ' Open Microsoft Jet Database object.
    Set wrkJet = CreateWorkspace("NewJetWorkspace", "admin", "", dbUseJet)
    Set dbsDB = wrkJet.OpenDatabase("C:\Data\Access\VersionOfJet.mdb")

    ' Create ODBCDirect Workspace object and open Connection objects.
    Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "", dbUseODBC)
'Rem because this db does not have an ODBC connection
Rem    Set conPubs = wrkODBC.OpenConnection("Connection1", , , "ODBC;DATABASE=pubs;UID=sa;PWD=;DSN=Publishers")

    ' Show three different uses for the Version property.
    MsgBox "Version of DBEngine (Microsoft Jet " & "in memory) = " & DBEngine.Version
    MsgBox "Version of the Microsoft Jet engine " & "with which " & dbsDB.Name & " was created = " & dbsDB.Version
'Rem because this db does not have an ODBC connection
Rem    MsgBox "Version of ODBCDirect connection " & "(using Database property) = " & conPubs.Database.Version

    dbsDB.Close
'Rem because this db does not have an ODBC connection
Rem    conPubs.Close
    wrkJet.Close
    wrkODBC.Close

End Sub

'Now I am guessing that I am getting the ODBC errors because my simple example db does not have any
ODBC connections. If I am wrong, please post back and explain why I would get the errors if I did not Rem
out those three lines. Thanks!
 
Hey,

Thanks for the help. That pretty much going the right direction. I was actually looking for the *detailed* version of jet installed on my pc so when i distribute it with a vb app i can be sure it's exactly what i've been testing it with.

Code below prints out '4.0' which sounds a bit too simple to be a specific release of jet but i'll keep looking into it. There's probably another way to find out which jet needs to be distributed. It's closer that the '9.0' which prints out using the Sys function though!!

Btw, are you still using XP with acc 97? I just responded to you older post a few hours ago.


Regarding the errors you mentioned, I have no idea. I'm not even going to play with ODBC connections anymore unless i need to. I've only been working with ADO recently and completely forget. But to guess, it looks like you might reference a odbc object that's not instantiated....

thanks again,
norm


Public Sub tryjet()
Dim wrkJet As DAO.Workspace
Dim db As DAO.Database

Set wrkJet = CreateWorkspace("NewJetWorkspace", "Admin", "", dbUseJet)
Set db = wrkJet.OpenDatabase(Application.CurrentDb.Name)

Debug.Print db.Version

End Sub
 
try commenting out the:

wrkODBC.Close

and see if you still get that error.....
 

Users who are viewing this thread

Back
Top Bottom