-1

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?

NewSites
  • 1,402
  • 2
  • 11
  • 26
  • 6
    This question is being [discussed on Meta](https://meta.stackoverflow.com/q/424858). – Cody Gray - on strike May 27 '23 at 14:01
  • Can't find anything that explains differences. Remove each library one at a time and see what code breaks. Use VBA editor Object Explorer to see what each library provides. I think they list as "Access" and "Office". The "Access" library is one of the default libraries in a new db. – June7 May 27 '23 at 14:39
  • 1
    Have you examined those libraries in the Object Browser as June7 suggested? Both are default libraries for an Access ACCDB file. The Object Browser will show you what features each provides. The database engine library will be listed as DAO in the library selector drop-down, and the Access object library will be listed as Access. – HansUp May 27 '23 at 15:04
  • Not for me. I don't give this much thought. I just know some code with early binding will break if appropriate library not loaded. I just tested removing the first library and the DAO listing disappeared, not the Office listing. And my DAO recordset code broke. – June7 May 27 '23 at 15:07

1 Answers1

5

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.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Andre
  • 26,751
  • 7
  • 36
  • 80
  • And that leads to question: What is **Microsoft DAO 3.6 Object Library** for? I understand it is obsolete and superseded by ACE. Would it need to be loaded if I open an MDB file? – June7 May 27 '23 at 15:28
  • I've edited the question to specify that I'm working in Outlook VBA. – NewSites May 27 '23 at 15:38
  • 1
    @June7: I don't know the specifics. I think ACE handles Access 2003 MDB at least, but perhaps not 2000 / 97 / ... You probably need DAO 3.6 for ADP. – Andre May 27 '23 at 15:47
  • @NewSites: ok, then you'll need only the Database Engine. – Andre May 27 '23 at 15:48
  • Can you explain why there are two libraries for Access, but only one each for Excel and Outlook, and why, when I use Excel from Outlook, I reference `Excel 16.0 Object Library`, but when I use Access from Outlook, I reference `Office 16.0 Access` library and not `Access 16.0 Object Library`? – NewSites May 27 '23 at 15:54
  • 3
    *"... two libraries for Access, but only one each for Excel and Outlook ..."* Your Access libraries: one is for the Access application; the other is for the database engine. Excel and Outlook do not provide database engines, so only libraries for their applications. – HansUp May 27 '23 at 16:02