11

using ASP.NET I need to update an excel template.

Our server is running Windows 2008 in 64 bit mode.

I am using the following code to access the excel file:

    ...
    string connection = 
@"Provider=MSDASQL;Driver={Microsoft Excel Driver (*.xls)};DBQ=" + path + ";";
    ...

IF the application pool is set to Enable 32 bit applications the code works as expected; however the oracle driver I am using fails as it is only 64 bit.

If Enable 32-bit applications is set to false the excel code fails with the error:

Data source name not found and no default driver specified

Any suggestions?

alexandrul
  • 12,856
  • 13
  • 72
  • 99
Ris Adams
  • 1,345
  • 4
  • 13
  • 25

5 Answers5

7

The Microsoft Office team has just released a 64-bit driver

Prahalad Gaggar
  • 11,389
  • 16
  • 53
  • 71
  • FYI, that driver is only for Office 2010 and up – Lizz Jun 30 '14 at 18:39
  • This only works if you set the application pool to Enable 32-bit applications to true for a Classic ASP application however. See http://stackoverflow.com/questions/32728007/microsoft-access-database-engine-2010-redistributable-64-bit-only-works-if-enabl – Dijkgraaf Sep 22 '15 at 23:02
2

There is also 2010 Office System Driver Beta: Data Connectivity Components Link which has allowed us to open Excel 2007 (XLS) from a 64bit environment.

This download will install a set of components that can be used by non-Microsoft Office applications to read data from Microsoft Office 2010 Beta files

Our connection string

@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + filePath + ";Extended Properties=\"Excel 12.0;HDR=YES;\""
Alex Nolasco
  • 18,750
  • 9
  • 86
  • 81
  • 2
    If you have a 32bit version of Office installed, it will give you an error message when you try to install it. But if you execute it with the `/passive` flag from the command line, it'll install side by side just fine. – CuppM Nov 02 '11 at 19:22
  • Use of the /passive flag helped me out so much, thanks!!! I was about to reinstall all of Office! – Kevin Radcliffe Nov 20 '11 at 08:48
2

Microsoft release a 64bit OLEDB FOR ODBC in 2008/04/04 http://www.microsoft.com/downloads/details.aspx?FamilyID=000364db-5e8b-44a8-b9be-ca44d18b059b&DisplayLang=en

Now you should able to run everything 64bit, can u try it and let us know the result and personally I think Microsoft should release a 64bit Jet Oledb 4.0, if the development team has no time to do it then just put it in codeplex.com and let other programmers do it.

0

There are no office drivers for 64bit released.

The (currently) last post at this link: MSDN Forum details a cumbersome and ugly workaround. You could also replace the Windows Service with a COM exposed assembly, if you wish. Still ugly though. :)

Robert Jeppesen
  • 7,837
  • 3
  • 35
  • 50
  • There seems to be a solution to this problem now through 2010 Office System Driver Beta: Data Connectivity Components – Alex Nolasco Mar 31 '10 at 14:40
-1

Install the 32-bit Oracle driver and enable 32 bit applications?

ErikE
  • 857
  • 8
  • 18