views:

324

answers:

4

I wrote an ASP.NET page that imported data from an Excel spreadsheet without any problems. Then I moved it to the server and found out that it didn't work on a 64 bit OS. After some Googling I found that MS does not have nor will it ever have a Jet DB driver for 64 bit OS. Does anyone have any suggestions for a way to easily import data using an ASP.NET page on a 64 bit OS? The client just wants some simple way to bulk import data. Ideally it would be an Excel spreadsheet or a CSV file. Ideally it wouldn't be super complicated. They want the non-technical business users to be able to fill out a spreadsheet (or something similar) and then go to a web page and upload it to the server. If there is no way to do this with a spreadsheet on a 64 bit OS, does anyone have any suggestions?

Thanks, Corey

+1  A: 

My suggestion would be to use a CSV if that's a possibility.

That way, you wouldn't be tied to the Microsoft JET Drivers. You could read the file and parse it using simple file IO.

Justin Niessner
Duh, of course! Sometimes you are so focused on solving something in a complex manner that you forget the simplest way. I will definitely do this. Thanks.
Corey Burnett
This method ended up being the easiest solution. That way I could keep everything 64 bit. I found a nice CSV reader that someone else had built at the following URL: http://www.codeproject.com/KB/database/CsvReader.aspx. It worked like a charm.
Corey Burnett
A: 

You can run your app pool for that asp.net site in 32 bit mode - and then the jet drivers should work.

IIS7...

appcmd apppool set /apppool.name:MySitesAppPool /enable32BitAppOnWin64:true

IIS6...

cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1
aspnet_regiis.exe -i

See my answer here for more details.

Scott Ivey
Do the JET Drivers even get installed on 64-bit platforms?
Justin Niessner
Yes, but they are 32 bit libs - so you can't load them from the 64 bit process that your app runs under.
Scott Ivey
Are there any down sides to running the app pool in 32 bit mode? Is it something that I can "undo" if need be?
Corey Burnett
Scott Ivey
in addition to scott i would suggest you create one web service and put all the logic of importing spreadsheet in that web service and return dataset or complete your operation. So you just need to enable App pool for that web service and not for entire application
Harryboy
A: 

SpreadsheetGear for .NET will let you import Excel workbooks and SpreadsheetGear supports 64 bit .NET as well as 32 bit .NET.

You can see live samples here and download the free trial here if you want to try it yourself.

Disclaimer: I own SpreadsheetGear LLC

Joe Erickson
A: 

If its Office 2007, then use the open XML format...... the rest becomes very clear :)

Darknight