As stated here I'm rebuilding tables from SQL Server to Access by using C# Thanks to the help I received I could finish the process but since the .accdb files are pretty large, I need to compact and repair them afterwards. For that, I used the marked answer from here. Strangely, there was only a reference for "Microsoft Office 16.0 Access Database Engine Object Library" that I could add to my project.
using Microsoft.Office.Interop.Access.Dao;
var engine = new DBEngine(); // Exception
var destFile = Path.GetFileNameWithoutExtension(filepath) + "_Compact" + ".accdb";
var destFilePath = Path.Combine(Path.GetDirectoryName(filepath), destFile);
engine.CompactDatabase(filepath, destFilePath);
At the Initialization of the DBEngine - Object, an exception is thrown:
Retrieving the COM class factory for component with CLSID {CD7791B9-43FD-42C5-AE42-8DD2811F0419} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Also, is there a way to use ADOX for this task, since I'm already using it for creating my catalogs?