views:

650

answers:

4

So, we are migrating an old web app from a 32-bit server to a newer 64-bit server. The app is basically a Classic ASP app. The pool is set to run in 64-bit and cannot be set to 32-bit due to other components. However, this breaks the old usage of Jet drivers and subsequent parsing of Excel files.

After some research, I downloaded the 64-bit version of the new 2010 Office System Driver Beta and installed it. Presumably, this allows one to open and read Excel and CSV files.

Here's the snippet of code that errors out. Think I followed the lean guidelines on the download page:

Set con = Server.CreateObject("ADODB.Connection")
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.14.0;Data Source=" & strPath & ";Extended Properties=""Excel 14.0;"""
con.Open

Any ideas why?

UPDATE: My apologies. I did forget the important part, the error message:

ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not
be properly installed.
/vendor/importZipList2.asp, line 56

I have installed, and uninstalled/reinstalled twice.

A: 

It could be the Excel version in the Extended Properties parameter. Excel 14 is for Office 2010. While the driver may be Office 2010 I would presume your Excel documents are not.
Excel 2007 - v12
Excel 2003 - v8
From http://www.connectionstrings.com for Excel 2007:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";

You could try replacing the ACE.OLEDB.12.0 with ACE.OLEDB.14.0 to match the driver version.

AUSteve
Unfortunately, as far as I understand it, the only Office drivers that come in a 64-bit version are the 2010 Beta drivers.
alphadogg
Your edit (with the error message) means that the problem is not in the connection string it's with the installation of the driver on the server - so my info is not helpful, sorry
AUSteve
A: 

Here http://forums.asp.net/p/1128266/1781961.aspx is a suggestion to split your app into 32 and 64 bit components and transfer data via COM. To quote:

What you need to do is split your application into a 32 bit part and a 64 bit part, use COM interop to cross the 64/32 bit boundary. For instance, drop the code (just a simple class library compiled as 32 bit) that retrieves the Excel data into a COM+ (System.EnterpriseServices) as a "server type" application, and call that server methods from your 64 bit Windows service. This is exactly why System.EnterpriseServices are made for.

AUSteve
A: 

I encountered a similar issue a little while ago and I found out that there's actually a bug in the installer package for the ACE 14 driver. The driver is being registered as "Microsoft.ACE.OLEDB.12.0". In my case I could get things to work just by changing my connection string to 12 as opposed to 14.

Evidence on the bug: link text

Valentino Vranken
A: 

I faced the same problem, finally, i realized that the error is that the connection string should be modified in 64bit!!

to get the right one, install visual basic 6 and drag the Microsoft data access control,through its wizard open the file u want, and let it write the connection string to u..

ayman