none
Crash initializing the MAPI (mapi extended or simple) using the Access Database Engine 2016 RRS feed

  • Question

  • Hi,

    we have a project which uses the mapi extended or the mapi simple to send e-mails (we can choose it. Usually we use the extended). It has worked us for a long time but now our application is crashing when we call this function to send an e-mail: MAPIInitialize.

    It's crashing when we use the access database, with the Microsoft database Engine 2016 installed. On the other hand, if we use sql server database or we use the access database but with the Microsoft database Engine 2010 installed, it works correctly.

    I attach the threads view in the crash moment:

    

    I attach the same image when it is working me correctly when we are using the Access Database Engine 2010:

    I have installed the Microsoft Outlook for Office 365 version 1809.

    Can any help me please?

    Thanks.

    Wednesday, October 31, 2018 9:05 AM

All replies

  • Try to initialize MAPI before you initialize the DB access.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, October 31, 2018 7:28 PM
  • Hi,

    thanks for your reply. If I do it, the mapi is initialized correctly (and I could send an e-mail correctly) but then I have the crash when I'm initializing the DB (and it's not reproduced if I don't initialize the mapi before the DB initialization).

    You can see here the crash in that situation:

    Do you have another suggestion?

    Thanks.

    Friday, November 2, 2018 7:15 AM
  • What is your exact version of Outlook 2016? Can you make sure you installed the latest updates?

    I have a vague recollection about about this problem, but that was a while back when Outlook 2016 was just released.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, November 2, 2018 9:45 PM
  • I have installed the Microsoft Outlook for Office 365 version 1809, build: 10827.20181.

    If I enter in the about of my Outlook I can read: Microsoft Outlook for Office 365 MSO (16.0.10827.20181) 64-bit.

    Monday, November 5, 2018 3:40 PM
  • That looks fine to me...

    Is opening a support case with MS an option?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, November 5, 2018 3:59 PM
  • Are you suggesting me create a question in another forum group?

    If you think that is not a MAPI/Outlook problem... yes we could open a new one...or move it directly no?

    Which forum could be the better place? Microsoft Office for developers? Access for developers? Or if you have any forum group suggestion...?

    Could we move directly this question to the new forum group?

    Thank you.

    Tuesday, November 6, 2018 7:59 AM
  • No, I am suggesting that you open a support case with Microsoft. You can start at https://support.microsoft.com/en-us/assistedsupportproducts?wa=wsignin1.0


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!


    Tuesday, November 6, 2018 2:41 PM
  • molistok....

    did you receive a solution for this issue?

    thanks

    Thursday, December 6, 2018 9:47 AM
  • The latest Office 365 update (11029) broke the MAPI system – when the MAPI system (msmapi32.dll) is loaded inside a process that has already loaded mso.dll (such as Access), it piggybacks on that dll (which can be outdated) instead of loading the matching version of mso.dll from Office 2016.
    Is opening a support case with MS an option? MS is aware of the problem, but support cases from the customers will help move the fix higher up the bug queue.
    In the meantime, the only workaround is to either upgrade Access to 2016 or downgrade Office 365 to a previous build (https://support.microsoft.com/en-us/help/2770432/how-to-revert-to-an-earlier-version-of-office-2013-or-office-2016-clic).

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Thursday, December 6, 2018 3:58 PM
  • Hi,

    following instructions on https://support.microsoft.com/en-us/help/2770432/how-to-revert-to-an-earlier-version-of-office-2013-or-office-2016-clic


    I tried with this configuration file:

    <Configuration>
    <Updates Enabled="TRUE" TargetVersion="16.0.10730.20205" />
    </Configuration>

    then
    setup.exe /configure config.xml

    then
    Excel, File>Account, Update Options > Update Now
     
    But this message apperars:

    An error occurred,
    Error code: 30125-27 (404)
    Retry later

    Friday, December 7, 2018 11:21 AM
  • For what it is worth, loading the Office 2016 version of mso.dll prior to loading and initializing MAPI seems to fix the crash.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, December 7, 2018 2:57 PM
  • Is there a way to load Office 2016 version of mso.dll with "Office 2016 Home & Business" (that does not contain Access)?
    Friday, December 7, 2018 3:14 PM
  • Sure, as long as it is there, just use LoadLibrary. You can figure out the dll  location from the HKCR\TypeLib\{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}\2.8\0\Win32 registry key (Win64 in case of 64 bit).

    You might need to change the current directory to the directory where the dll is located prior to calling LoadLibrary.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, December 7, 2018 3:30 PM
  • I tried with LoadLibrary but it does not solve the problem...

    this is the code (module in a Access 2013 mdb):

    Option Explicit
    Option Compare Database

    Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long

    Private Const MAPI_LOGON_UI = &H1
    Private Const MAPI_NEW_SESSION = &H2
    Private Const MAPI_PASSWORD_UI = &H20000

    Private Declare Function MAPILogon Lib "MAPI32.DLL" (ByVal UIParam As Long, ByVal User As String, ByVal Password As String, ByVal Flags As Long, ByVal Reserved As Long, ByRef Session As Long) As Long

    Private m_SessionID As Long

    Public Sub testMAPI()
        
        LoadLibrary "C:\Program Files (x86)\Microsoft Office\Root\VFS\ProgramFilesCommonX86\Microsoft Shared\OFFICE16\MSO.DLL"
        
        'next line generate msaccess crash (Access 2013 runtime)
        'prior of last office2016 update (version 1811 build 11029.20079), it worked perfectly
        Call MAPILogon(ByVal 0&, vbNullChar, vbNullChar, MAPI_LOGON_UI, ByVal 0&, m_SessionID)
        
        '...
        '...
        '...
    End Sub




    • Edited by lorisco Friday, December 7, 2018 4:09 PM
    Friday, December 7, 2018 4:04 PM
  • You are not checking that LoadLibrary returns a valid handle. As I mentioned before, try to programmatically change the current directory to ""C:\Program Files (x86)\Microsoft Office\Root\VFS\ProgramFilesCommonX86\Microsoft Shared\OFFICE16\" prior to calling LoadLibrary.

    You can do that, for example, using https://blogs.technet.microsoft.com/heyscriptingguy/2005/02/01/how-can-i-change-the-working-folder-of-a-script/


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!


    Friday, December 7, 2018 4:19 PM
  • Dmitry, YOU'RE RIGHT, THIS WAY IT WORKS !!!!!

        

    Adding thise code before MAPILogon, solve the problem

        Dim lng As Long

        ChDir "C:\Program Files (x86)\Microsoft Office\Root\VFS\ProgramFilesCommonX86\Microsoft Shared\OFFICE16"
        lng = LoadLibrary("C:\Program Files (x86)\Microsoft Office\Root\VFS\ProgramFilesCommonX86\Microsoft Shared\OFFICE16\MSO.DLL")

    LoadLibrary returns a random value like 195887104

    This can be a temporary and farraginous workaround, I hope Microsoft will bring a solution as soon as possible..

    Thanks


    Friday, December 7, 2018 4:44 PM