Can't open Excel spreadsheet from within .Net web app on Windows XP

  • Thread starter Thread starter Bill Youngman
  • Start date Start date
B

Bill Youngman

I'm trying to write an import utility for a web app that I am developing and I'm using an Excel spreadsheet to hold the data to be imported.

I'm using ODBC and this is my connection string--

"Driver={Microsoft Excel Driver (*.xls)};Dbq=" + HttpContext.Current.Server.MapPath(".//" + csv_store_read);"

where csv_store_read is the directory where the Excel file is.

My application has to use a user account other than the anonymous internet account due to the requirements of the external system that it is accessing. I also have Impersonate set to true in the Web.config file.

I've also hard coded the file path to point to the file on the local machine and neither are working. I keep getting the following error:

[Microsoft][ODBC Excel Driver] Disk or network error.

This works fine on my Windows 2000 machine so I know it has something to do with security but I've tried everything I can think of to no avail.

Any ideas as to what I am missing?

TIA,

Bill Youngman
 
¤ I'm trying to write an import utility for a web app that I am developing and I'm using an Excel spreadsheet to hold the data to be imported.
¤
¤ I'm using ODBC and this is my connection string--
¤
¤ "Driver={Microsoft Excel Driver (*.xls)};Dbq=" + HttpContext.Current.Server.MapPath(".//" + csv_store_read);"
¤
¤ where csv_store_read is the directory where the Excel file is.
¤
¤ My application has to use a user account other than the anonymous internet account due to the requirements of the external system that it is accessing. I also have Impersonate set to true in the Web.config file.
¤
¤ I've also hard coded the file path to point to the file on the local machine and neither are working. I keep getting the following error:
¤
¤ [Microsoft][ODBC Excel Driver] Disk or network error.
¤
¤ This works fine on my Windows 2000 machine so I know it has something to do with security but I've tried everything I can think of to no avail.
¤
¤ Any ideas as to what I am missing?
¤

Have you tried using Jet OLEDB with the Excel ISAM driver? I would avoid using ODBC if possible.

Also, have you provided sufficient permissions, for the user you are impersonating, to access the
folder where the Excel file is located?

I would also verify that the path (Dbq) to your Excel file is correct.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
I switched over to using OleDb and am now getting this error - 0x80004005
'unspecified error'.

I double checked the permissions on the file and the impersonated user has
full rights to the file. I found some threads that said to also set the
windows\temp directory to include this user as well, so I did that. Nothing
seems to work.

Help!!!!
 
¤ I switched over to using OleDb and am now getting this error - 0x80004005
¤ 'unspecified error'.
¤
¤ I double checked the permissions on the file and the impersonated user has
¤ full rights to the file. I found some threads that said to also set the
¤ windows\temp directory to include this user as well, so I did that. Nothing
¤ seems to work.
¤

Have you tried installing the latest Jet database engine service pack?

http://support.microsoft.com/kb/239114/


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Through Google and searching on 'oledb excel asp.net' I found a posting that detailed the 'unspecified error' that I am getting and it suggested two things -

- The first was to make sure that the directory where the file is located has the proper permissions - did that.
- The second was to go to C:\Documents and Settings\machinename\ASPNET\Local Settings\Temp and make sure that the account that you are using for impersonation has permissions for this folder as well. Hadn't done that - but after I did I am now getting this 'Could not find installable ISAM' - I guess it's progress though.
 
¤ Through Google and searching on 'oledb excel asp.net' I found a posting that detailed the 'unspecified error' that I am getting and it suggested two things -
¤
¤ - The first was to make sure that the directory where the file is located has the proper permissions - did that.
¤ - The second was to go to C:\Documents and Settings\machinename\ASPNET\Local Settings\Temp and make sure that the account that you are using for impersonation has permissions for this folder as well. Hadn't done that - but after I did I am now getting this 'Could not find installable ISAM' - I guess it's progress though.
¤

The ISAM error usually indicates that there is a syntax error in your connection string. Can you
post an example?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top