Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I get the MDB version number using code? 2

Status
Not open for further replies.
Jun 6, 2001
5
NZ
I have 450+ databases that are spreadout over different versions of access, from Access 2, 95, 97, 2000..

I am wanting to identify the version of the database. Can this be done using code with ADO, or DAO?

 
Function test()
Dim dbs As Database

Set dbs = CurrentDb()
Debug.Print dbs.Version

End Function Chris
grandin1@yahoo.com
 
Add the following function to an Access 2000 module:

Function GetDbVersion(sDbFullPath As String) As String
Dim dbs As Database

Set dbs = DbEngine.OpenDatabase(sDbFullPath)
GetDbVersion = dbs.Version
dbs.Close
Set dbs = Nothing
End Function

The online help for the Version Property of a Database object equates these version number and Access products:

DB Version Access Product
---------- --------------
1.0 1.0
1.1 1.1
2.0 2.0
2.5 N/A (VB 4.0 16-bit)
3.0 Access 95
3.5 Access 97
4.0 Access 2000
 
Do a variation of the following:

Option Explicit
Dim cn As ADODB.connection
Dim rs As ADODB.Recordset

Private Sub Command1_Click()
MsgBox cn.version
End Sub

Private Sub Form_Load()
Set cn = New ADODB.connection
Set rs = New ADODB.Recordset
cn.Open "Provider = Microsoft.jet.OLEDB.4.0;data source = f:\rtdtapps\rtdgl\gledger.mdb"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top