JET Data Providers and 64-bit VISTA

This is a well-documented issue, but I’m saving these notes anyway because it took a while to figure out.
I’m doing some maintenance on a web application that uses Excel files as data sources.
The files require the JET Data Provider.
The app is running under VISTA on a 64-bit machine.
I was getting the error message “The ‘Microsoft.Jet.OLEDB.4.0’ provider is not registered on the local machine.”
For VISTA, the JET .dlls are located in the WindowsSysWOW64 directory, not Program FilesCommon FilesSystemOle DB
I tried re-registering the .dlls. No luck.
Turns out, Jet only has 32 bit versions, so you have to change the target CPU of the app to x86.
In C#, there is no “Advanced Compiler” project property, this is only available in VB.NET.
On IIS7, though, there is an option to run your app in 32-bit mode. In the Advanced Options under the Application Pools where your app is (mine uses DefaultAppPool), there’s an option to Enable 32-bit Applications (it was False by default). Changing this to True worked.
The C# project file does have a section “Platform Condition=” ‘$(Platform)’ == ” “>AnyCPU” It may be possible to edit this, but I didn’t try it.
List of JET .dlls: http://support.microsoft.com/kb/278604
Excellent resource:
http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/45aa44dd-0e6f-42e5-a9d6-9be5c5c8fcd1/
Jet 4.0 db engine service pack download: http://support.microsoft.com/kb/239114