• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2868
  • Last Modified:

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
0
andy7789
Asked:
andy7789
  • 3
  • 2
1 Solution
 
MCKreedCommented:
Are you using 32 bit or 64 bit Windows?

0
 
andy7789Author Commented:
64 bit Win 7 Ultimate

My old machine was 32
0
 
MCKreedCommented:
Check out this link, it may help:
http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/45aa44dd-0e6f-42e5-a9d6-9be5c5c8fcd1

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.
0
 
andy7789Author Commented:
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.
0
 
MCKreedCommented:
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.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now