Search code examples
vbams-access

What is the difference between "Access Database Engine Object Library" and "Access Object Library"?


The Stack Overflow question, Link Outlook to Access, has a detailed answer that starts with adding a reference to "Microsoft Office x.0 Access database engine Object Library". In Outlook VBA, my references list has two items:

  • Microsoft Office 16.0 Access Database Engine Object Library
    • C:\Program Files\Common Files\Microsoft Shared\OFFICE16\ACEDAO.DLL
  • Microsoft Access 16.0 Object Library
    • C:\Program Files\Microsoft Office\root\Office16\MSACC.OLB

The first one is clearly what Thomas G's answer is referring to, but the second one looks extremely similar. They are both for the same version of Microsoft Access.

Note that the references for Excel and Outlook are only:

  • Microsoft Excel 16.0 Object Library
    • C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE
  • Microsoft Outlook 16.0 Object Library
    • C:\Program Files\Microsoft Office\root\Office16\MSOUTL.OLB

There is no other library whose name starts with "Microsoft Office 16.0" besides the one for Access.

What is the difference between these two libraries? Under what circumstances would I use one or the other?


Solution

  • Your linked question talks about working with an .accdb from Outlook VBA.

    It is unclear from your question if you want to do the same, but since you haven't tagged Outlook, I assume you are talking about a VBA project in MS-Access.

    Anyway, the short answer is: in an Access project, you always want both references.

    Microsoft Access 16.0 Object Library is all the frontend stuff in Access - forms, reports, etc.
    In any normal Access project, you can't even unselect it, since it is always used.

    Outside Access, you would only need it if you want to automate an Access frontend, e.g. from Excel.

    Microsoft Office 16.0 Access Database Engine Object Library is the, well, database engine.
    Also known as ACE, or the successor of DAO (including all of DAO functionality). You need it to work with any kind of DAO objects, like your regular DAO.Recordset.

    Outside Access, you use it to work with tables in Access databases. Like in the linked question.