VB.NET: "Provider cannot be found. It may not be properly installed" - Jet.OLEDB 4.0

Posted on 2009-12-21
Last Modified: 2013-12-25
Hi X-perts,

I am migrating to a new fresh PC with windows 7 and getting the above exception "Provider cannot be found. It may not be properly installed" when executing a simple

rc = New ADODB.recordset
Call,.....) '====> exception returned

I have checked all the references, MDAC versions etc. It looks fine (anyway, it is a working code from the XP machine).

Note that the code works OK, when called as a linked Excel COM. it returns exceptions only, if executed directly or when debugging.

What could be a problem here? What am I missing?

Question by:andy7789
    LVL 1

    Expert Comment

    Are you using 32 bit or 64 bit Windows?


    Author Comment

    64 bit Win 7 Ultimate

    My old machine was 32
    LVL 1

    Accepted Solution

    Check out this link, it may help:

    The links to the tips site keep bringing you to the home page of the site. To set the compiler to 32 bit go to the properties of your app, click compile and the advanced compile options. You can set the target CPU to x86.

    Author Comment

    Thank you! It was the case. I have changed from Any PC to x86 and it works OK now. Any ideas why it was working before (Any PC target) when calling as COM from Excel?

    It was the same ("Any PC") assembly.
    LVL 1

    Expert Comment

    if the Excel is x86 based then it would run under the x86 code base. The any CPU should normally work but I guess there are cases when it doesn't, as in this one. My guess, and it is just that, is using the any cpu allows it to be called from whatever the base the OS is, so running it from an x64 would not allow it to call the x86 jet provider. Setting it to x86 forces it to be called by the x86 code base allowing it to access the jet provider.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now