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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifyng DB version

Status
Not open for further replies.
Jul 20, 2001
1,153
US

Anyone out there know how to get the version property of a 2000 DB from '97 code ?

I have a module that creates a table of all of the DBs on local and newtork drives. I am using the Application.FileSearch method and the .FoundFile property for my information.

My next step is to automate routine maintainence. (Compact, Etc). I'll use the file and path returned from the .foundFile object and open the DB, etc....

Problem is, we've got a mixed enviroment of '97 and 2000 machines. If I run the code from '97, it'll just fail. If I run it from 2000, it'll probably ask me if I want to open or convert.
 
Sometimes a hedge is quicker than finding the solution...
Use a 97 backend and if you can open the database in 97 without error mark it as 97... in 2000 Front End do the same for the remaining databases... The remaining databases are a problem...

Other thought... the version may be a file property and you can probably get at it with an API call. Do your digging at if you really want to explore this option.
 
Yeah, as a quick fix I trapped the errors using this:

Code:
Private Sub ModAllDBs()
Dim i As Integer
Dim wrkJet As Workspace
Dim rst1 As Recordset
Dim rst2 As Recordset
Dim dbs As Database
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set rst1 = CurrentDb.OpenRecordset("tblError")
Set rst2 = CurrentDb.OpenRecordset("tblNew")
On Error GoTo err_hand
rst2.MoveFirst
Do While Not rst2.EOF
    Set dbs = wrkJet.OpenDatabase(rst2.Fields(0).Value)
    dbs.Close
    Set dbs = Nothing
AfterError:
    rst2.MoveNext
Loop

err_hand:
With rst1
.AddNew
!DBName = rst2.Fields(0).Value
!ErrDesc = Err.Description
!ErrNum = Err.Number
.Update
Resume AfterError
End With
End Sub

I'll check out that web-site
Tyrone Lumley
augerinn@gte.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top