Link to home
Start Free TrialLog in
Avatar of andy7789
andy7789

asked on

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

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 rc.open(SQL,.....) '====> 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?

Thanks
Avatar of MCKreed
MCKreed

Are you using 32 bit or 64 bit Windows?

Avatar of andy7789

ASKER

64 bit Win 7 Ultimate

My old machine was 32
ASKER CERTIFIED SOLUTION
Avatar of MCKreed
MCKreed

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.