Applies To Database object, DBEngine object.
Description
Return Values
Microsoft Jet Version (year released) | Microsoft Access | Microsoft Visual Basic | Microsoft Excel | Microsoft Visual C++ |
1.0 (1992) | 1.0 | N/A | N/A | N/A |
1.1 (1993) | 1.1 | 3.0 | N/A | N/A |
2.0 (1994) | 2.0 | N/A | N/A | N/A |
2.5 (1995) | N/A | 4.0 (16-bit) | N/A | N/A |
3.0 (1995) | 95 (7.0) | 4.0 (32-bit) | 95 (7.0) | 4.x |
3.5 (1996) | 97 (8.0) | 5.0 | 97 (8.0) | 5.0 |
See Also CreateDatabase method.
Specifics (Microsoft Access) Databases created in Microsoft Access 97 and Microsoft Access 95 have the same file format. Therefore, the Version property of a Database object returns 3.0 for databases created in or converted to either Microsoft Access 97 or Microsoft Access 95. If you need to distinguish between databases in Microsoft Access 97 format and databases in Microsoft Access 95 format, use the SysCmd function with the intrinsic constant acSysCmdAccessVer as the action argument to determine which version of Microsoft Access created the database. For a Microsoft Access 97 database, the SysCmd function will return 8.0. For a Microsoft Access 95 database, it will return 7.0. Example This example uses the Version property to report on the Microsoft Jet database engine in memory, a Microsoft Jet database, and an ODBC connection.Sub VersionX()
Dim wrkJet As Workspace
Dim dbsNorthwind As Database
Dim wrkODBC As Workspace
Dim conPubs As Connection
' Open Microsoft Jet Database object.
Set wrkJet = CreateWorkspace("NewJetWorkspace", _
"admin", "", dbUseJet)
Set dbsNorthwind = wrkJet.OpenDatabase("Northwind.mdb")
' Create ODBCDirect Workspace object and open Connection
' objects.
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", _
"admin", "", dbUseODBC)
Set conPubs = wrkODBC.OpenConnection("Connection1", , , _
"ODBC;DATABASE=pubs;UID=sa;PWD=;DSN=Publishers")
' Show three different uses for the Version property.
Debug.Print "Version of DBEngine (Microsoft Jet " & _
"in memory) = " & DBEngine.Version
Debug.Print "Version of the Microsoft Jet engine " & _
"with which " & dbsNorthwind.Name & _
" was created = " & dbsNorthwind.Version
Debug.Print "Version of ODBCDirect connection " & _
"(using Database property) = " & _
conPubs.Database.Version
dbsNorthwind.Close
conPubs.Close
wrkJet.Close
wrkODBC.Close
End Sub