Determining .mdb version

  • Thread starter Thread starter Kevin Harris
  • Start date Start date
K

Kevin Harris

Is there any way to determine what version of Access
created an MDB ? We are rolling out a script to compact
MS Access databases in a server environment. Some legacy
groups have Access 2.0 databases and if we run the compact
script it will corrupt them unless we skip over them ...
 
There is a SysCmd function which will returns the Access version.

ReturnVariable = SysCmd(acSysCmdAccessVer)

or test for a particular version:

If SysCmd(acSysCmdAccessVer) = 2 Then
MsgBox "This is the Access 2.0
End If

The above is a guess, because I no longer have Access 2.0 to test it.
However, you *can* test for versions 7-11 and if it doesn't match, then
don't compact:

ReturnVariable = SysCmd(acSysCmdAccessVer)
If Not (ReturnVariable = 7 Or _
ReturnVariable = 8 Or _
ReturnVariable = 9 Or _
ReturnVariable = 10 Or _
ReturnVariable = 11) Then
MsgBox "This is the Access 2.0
End If

Anyway, play around with it and see what works best.
 
That would be the version of Access that has the database open, not the
version of Access that created the database initially. This is significant
depending on what version the OP wants when the db was created in one
version & then updated to a later one :-)

Cheers,
TC
 
Back
Top