Deploying VSTO 2005 SE Outlook addin using ADODB queries RRS feed

  • Question



      I'm attempting to write an Outlook add-in using VSTO 2005 SE that queries an Access database.  On my development machine, the code runs perfectly.  However, after deploying and installing on another machine, the add-in loads and works correctly up until it hits the function with the code to execute the queries, at which point it looks as though it doesn't even enter the function (e.g. I never see the MessageBox that says "Entering").  If I comment out the lines as shown below, I see the messagebox, and the rest of the add-in executes as expected.  I suspect this has something to do with not having the correct pre-requisites installed on the target machine, but I'm not sure what those should be.  I have already set MDAC 2.8 to be installed on the target machines when running setup.exe. 


    String Search(String number)


    String Results = "\nFrom DB: \n";




    ADODB.Connection conn = new ADODB.Connection();

    ADODB.Recordset rs = new ADODB.Recordset();

    //open the excel spreadsheet from geeves

    String cnStr = "Provider=Microsoft.Jet.OLEDB.4.0;data source=\\<networkShareLocation>.mdb;";

    String queryStr = "SELECT name, email, phone FROM Table WHERE phone LIKE '%" + number + "%'";

    conn.Open(cnStr, "", "", 0);

    rs.Open(queryStr, conn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly, 8);

    while (!rs.EOF)


    GALresults = GALresults + rs.Fields[0].Value.ToString() + "; " + rs.Fields[1].Value.ToString() + "; " + rs.Fields[2].Value.ToString() + "\n";







    return Results;



    Any help would be appreciated.



    Friday, December 14, 2007 6:43 PM

All replies


    Is the ADODB PIA installed on the deployed machine?


    Although not related to VSTO this article might help troubleshoot problems with ADO


    Saturday, December 15, 2007 12:08 AM
  • I do have the ADODB PIA installed on the deployed machine -


    I can see adodb.dll in Program Files\Microsoft.NET\Primary Interop Assemblies and


    Interop.ADODB.DLL in both my add-in directory as well as in C:\Documents and Settings\akhetan\Local Settings\Application Data\assembly\dl3\6HP46GYT.Q9E\C16QH83B.0C1\79a114ff\008caf62_cf3bc801


    In my project, i have Interop.ADODB.dll listed as a dependency in my setup project.


    Is there anything else I am missing?



    Monday, December 17, 2007 10:09 PM