We are using Microsoft.Office.Interop.Access.Dao (version 15.0.0.0) library for accessing information in Microsoft Access files, because it allows us to achieve some functionalities that other libraries lack (for example ability to relink database tables). This works very good with all types of Access files except Access 97 .mdb files. We periodically get exceptions when calling OpenDatabase method.
var engine = new DBEngine();
var db = engine.OpenDatabase(path);
It periodically throws COMException
Type: System.Runtime.InteropServices.COMException
Message: Cannot open a database created with a previous version of your application.
StackTrace: at Microsoft.Office.Interop.Access.Dao.DBEngineClass.OpenDatabase(String Name, Object Options, Object ReadOnly, Object Connect)
I tried to specify DefaultType, but the result is the same
engine.DefaultType = (int)WorkspaceTypeEnum.dbUseJet;
I would think that Access 97 files are not supported with the version of this library, but sometimes it processes files. Even when it fails, second attempt of opening same set of files pretty much always is being successful. So I wonder if there is a specific reason for these inconsistencies and if someone had experience with solving those.