I use the same provider in classic asp on the same machine so I know it's there. I will try connecting with the dataset though. Thanks
Main Topics
Browse All TopicsI am getting an unspecified error on the connection.open line when attempting to connect to an excel spreadsheet. The spreadsheet contains headings and is in the proper format. The sheetname and the filename are the same.
I am fairly new to .NET, and I have been able to do this in the past through classic ASP. Any help would be greatly appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The error that I get with try catch is still "Unspecified error".
The stacktrace is
at System.Data.OleDb.OleDbCon
Through doing some research online, I have found that OleDb Providers suppress raised errors so I switched an Odbc Driver connection. I am still getting an error, but it seems more useful than "Unspecified error".
Here are the errors:
ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x384 Thread 0x340 DBC 0x3da9f4 Excel'.
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x384 Thread 0x340 DBC 0x3da9f4 Excel'.
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [HY000] [Microsoft][ODBC Excel Driver] Disk or network error.
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x384 Thread 0x340 DBC 0x3da9f4 Excel'.
ERROR [HY000] [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x384 Thread 0x340 DBC 0x3da9f4 Excel'.
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute Extended Properties
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute HDR
ERROR [01S00] [Microsoft][ODBC Excel Driver]Invalid connection string attribute IMEX
ERROR [HY000] [Microsoft][ODBC Excel Driver] Disk or network error.
Stack Trace:
" at System.Data.Odbc.OdbcConne
From these articles in MSDN, it appears to be permissions problems in your Temp folder:
PRB: Error Message: 0x80004005: General Error Unable to Open Registry Key
http://support.microsoft.c
FP: Error: Unable to Open Jet Temporary Key When You Attempt to Connect to Database
http://support.microsoft.c
reference
Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process
http://www.experts-exchang
I just tried the fix suggested on MSDN. I gave full control permissions to the IUSR account to the HKEY_LOCAL_MACHINE\SOFTWAR
now i think we are moving in right direction
this is a known issue and its solution can be found at
http://support.microsoft.c
http://bytes.com/topic/asp
http://www.experts-exchang
Ok... here's the latest. The excel file that I am connecting to was created from a classic asp page using html so I needed to change the extended properties to reflect this. I am now able to connect to the file using an oledbconnection with a dataset by changing one parameter:
Extended Properties=HTML Import... instead of Extended Properties=Excel 8.0
However, I still get "Unspecified error" when using the same connection string in C#. I would love to just use the Dataset connection, however the excel file will be uploaded to the server and will always be different. I suppose I could save over the same file on every upload and use the same filename every time. This is the route I will take if no one has any answers here.
Yes, I hadn't realized that was an import detail since it didn't matter in classic ASP. I do need help saving the file using the excel object. Thanks for offering. Do I need to have office installed on the web server to do this? I don't think we do currently and I doubt that my company will allow it.
yes you will need office on the server
one more thing you can do
create an empty template excel file and then when you are saving the content
instead of saving html data save using DOM (above method you are using for reading data )
then read the content whenever you require
the main benefit will be
1. the file will be pure excel file and hence there will be no problem in reading
2. you wont need office on the server
3. also your task will be completed
i know this will increase your work but everything will work without installing office
and if you can arrange office then i will tell you the way of using Excel object
I attempted to connect to a pure excel file just so I would be able continue my work and I am getting the same "Unspecified error" on opening the connection. I have come to realize that this is an environment issue with the dev box I'm working on. A co-worker ran the same script on their machine and it connects to the file with no errors. I am also having problems connecting to a "normal" excel file on this machine so I have a different issue than I originally thought.
Business Accounts
Answer for Membership
by: DanSo1Posted on 2009-08-10 at 06:35:18ID: 25059762
What you can try it to add DataSet to the project. Then put TableAdapter and try to configure connection to your xls file.
Are you sure that you have allready installed proper provider?
Regards
Daniel