Is there any code solution to force a database to use the Jet engine for Access97, but to gracefully close down if a later version of Access attempts to open the MDB?
Dim objConn As ADODB.Connection
Private Sub Form_Load()
Set objConn = New ADODB.Connection
objConn.Open "Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = D:\AccessDB\Development.mdb"
If objConn.Properties("DBMS Version" > 3.51 Then
MsgBox "You are using a version of Access greater than 97. Application closing"
Docmd.Close Me
End If
End Sub
Hi Omega36,
The users of this database have Access97 and Access2002 on their systems. The preferred method of opening this database is by using a shortcut which forces the Access97 application to open the database which was written in Access97.
Occasionally, it is forgotten that this is an Access97 file, and it is opened with the default version, Access2002.
When Access 2002 attempts to open this Access97 mdb, it first offers to convert or open the database.
Whichever is chosen, it reports there are errors in converting the code (even before adding your sub Form_Load()).
Then, the Main form, opens by an AutoExec macro, after a long conversion process, including a compaction of the database, as normal.
It does not appear that the Sub Form_Load() stops this.
I think that I may need something to change the default behaviour of Access2002 when it encounters an MDB belonging to an earlier version.
Unfortunately the search is down on this site, as I also need to stop the default behaviour of the mouse wheel on forms.
Billpower, this is exactly what I do. However the default Office version is XP, and it is a problem stopping Access 2002 from accidentally attempting to open the mdb, if the mdb file is clicked on in Explorer.
What I would like to do is change the default ability of later versions of Access to offer to open or convert certain databases which use earlier versions of the Jet engine to just gracefully refuse to load the mdb, if some flag is set in the mdb to deny this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.