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

How to force users to open a database in Access97, not 2002

Status
Not open for further replies.

c0i0nes

Technical User
Apr 25, 2001
68
GB
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
 
Thankyou, Omega36, for your swift reply I shall go and try it out now.
 
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.
 
Couldn't you place a shortcut on the user's desk top, something like this:

"C:\Program Files\OFFICE97\MSACCESS.EXE" "C:\My Documents\Access97.mdb"

Basically, you just precede the DB you want to open with the location of Access 97.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top