Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered...' when I test my service

$
0
0
Hi Guys

I've got a WCF library that I'm testing. One of the services reads data from an excel file using an OLEDB connection. The connection string reads:-
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TestData\iris_data.xlsx;Extended Properties="Excel 8.0;HDR=YES"

I've got two sets of tests. One which calls the underlying implementation of the service and one which calls the service layer. The service layer is just pass-throughs which call the underlying implementation. There's no intelligence in the service layer at all.

The test that calls the underlying implementation direct is working fine. It reads the data and does it's work. However, when I call it via the service layer I'm getting an error message that "The 'Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine". I'd have thought I'd get the same result in both places but obviously not.

My best guess at what is happening is that the driver is registered on the local machine (as in the physical box that's sat on the desk in front of me) because otherwise the first test would fail. However, whencalling the service, VS sets up a virtual web server to host the service and it's that virtual machine that doesn't have the driver on it.

So my question is: Assuming I'm correct, how do I tell the virtual machine to load up and register the driver? If my assumptions aren't correct can anyone suggest what else may be going on?

Thanks in advance.

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>