Bug 56903

Summary: Moz-free Outlook Address Book driver
Product: LibreOffice Reporter: Lionel Elie Mamane <lionel>
Component: DatabaseAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: medium CC: caolanm, d.ostrovsky, dr, ernstke+freedesktopbugzilla, iplaw67, libreoffice, lionel, michael.meeks, mst.fdo, sbergman, thomas-libo
Version: unspecified   
Hardware: All   
OS: Windows (All)   
Whiteboard: EasyHack DifficultyInteresting SkillCpp SkillSQL
i915 platform: i915 features:
Bug Depends on: 56904    
Bug Blocks: 56902    

Description Lionel Elie Mamane 2012-11-09 06:11:32 UTC
Make a LibreOffice connectivity/sdbc driver that does not use the in-tree ancient Mozilla copy.

The easiest would probably just to access it over ADO (like we do for Microsoft Access files). It needs Jet 4.0, which is bundled with some versions of Windows, but not the most recent ones. But there is a redistributable that we can bundle: "Microsoft Access Database Engine 2010 Redistributable" http://www.microsoft.com/en-us/download/details.aspx?id=13255

To do that, just take inspiration of our drivers for "Microsoft Access" (.mdb) and "Microsoft Access 2007" (.accdb): they just under the hood rewrite the SDBC URL to the right SDBC-ADO URL, possibly set some parameters, and hand off the connection to the SDBC-ADO driver. This would not need *any* mucking with SQL, ADO/Jet handles it all.

The drives are declared in 
connectiviy/registry/ado/org/openoffice/Office/DataAccess/Drivers.xcu:

    <node oor:name="sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=*" oor:op="replace">

and

    <node oor:name="sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=*" oor:op="replace">

See also dbaccess/source/core/misc/dsntypes.cxx function ODsnTypeCollection::extractHostNamePort

Then the SDBC-ADO driver recognises this ":access:" prefix specially:

connectivity/source/drivers/ado/AConnection.cxx function OConnection::construct:

    if ( aDSN.compareToAscii("access:",7) == 0 )

I suggest to introduce an ":outlook:" prefix.


References:
I see several references to
http://msdn.microsoft.com/library/en-us/dnsmart00/html/sa00h12.asp but
it gives me a blank page right now.
Alternative references:
http://support.microsoft.com/kb/275262
http://www.codeproject.com/Questions/192505/Connection-String-for-Outlook-2010
http://www.freevbcode.com/ShowCode.asp?ID=3886
http://vbcity.com/forums/t/6878.aspx
http://msdn.microsoft.com/en-us/library/office/aa160682%28v=office.11%29.aspx



Another path would be to access Outlook directly over COM/... This would need handling the SQL ourselves, like our mork driver does (connectivity/source/drivers/mork)

There are examples (for VBA) there:

http://support.microsoft.com/kb/290792
http://support.microsoft.com/kb/290658
http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/812d1fb3-a997-487e-9c4f-75227521d4b8
http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/1cf06a86-2a28-4359-8046-6c5b5a5fd934
Comment 1 Lionel Elie Mamane 2012-11-12 15:02:20 UTC
David Ostrovsky dixit in http://lists.freedesktop.org/archives/libreoffice/2012-November/040889.html

> I personally think it is a no go to have two different approaches for
> O and OE integration.
> As discussed with Fridrich on LO Congress, i took a look at seamonkey
> way to handle it. They simple open MAPI.DLL
> and use WAB restriction API to access it. Moreover the algorithms and
> the  data strucures in mozab
> (and therefore in mork driver) seems to match 1 to 1 to these api.
> So one straightforward way to integrate both O and OE would be to
> borrow these 5 files from seamonkey tree and adapt it for our need.

As remarked by Michael Meeks in http://lists.freedesktop.org/archives/libreoffice/2012-November/040905.html, following that path, probably better to take that code off *latest* Seamonkey or even better Thunderbird rather than copying the ancient thing we have in-tree.
Comment 2 Björn Michaelsen 2013-10-04 18:47:29 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 3 DavidO 2014-11-04 21:05:30 UTC
So what is the current name for the API?

"Windows Address Book (WAB) API"

or

"Windows Contacts API"

apparently they make a new one with every windows release?
Comment 4 Alex Thurgood 2015-01-03 17:41:18 UTC
Adding self to CC if not already on

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.