PC Review


Reply
Thread Tools Rate Thread

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

 
 
Bill Youngman
Guest
Posts: n/a
 
      28th Oct 2005
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

 
Reply With Quote
 
 
 
 
Paul Clement
Guest
Posts: n/a
 
      31st Oct 2005
On Fri, 28 Oct 2005 16:08:20 -0400, "Bill Youngman" <(E-Mail Removed)> wrote:

¤ 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)
 
Reply With Quote
 
Bill Youngman
Guest
Posts: n/a
 
      1st Nov 2005
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!!!!

"Paul Clement" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Fri, 28 Oct 2005 16:08:20 -0400, "Bill Youngman"
> <(E-Mail Removed)> wrote:
>
> ¤ 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)



 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      1st Nov 2005
On Tue, 1 Nov 2005 11:10:45 -0500, "Bill Youngman" <(E-Mail Removed)> wrote:

¤ 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)
 
Reply With Quote
 
Bill Youngman
Guest
Posts: n/a
 
      1st Nov 2005
Yes I already have it on my machine.

"Paul Clement" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Tue, 1 Nov 2005 11:10:45 -0500, "Bill Youngman"
> <(E-Mail Removed)> wrote:
>
> ¤ 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)



 
Reply With Quote
 
Bill Youngman
Guest
Posts: n/a
 
      1st Nov 2005
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.

"Bill Youngman" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Yes I already have it on my machine.
>
> "Paul Clement" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> On Tue, 1 Nov 2005 11:10:45 -0500, "Bill Youngman"
>> <(E-Mail Removed)> wrote:
>>
>> ¤ 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)

>
>

 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      2nd Nov 2005
On Tue, 1 Nov 2005 16:07:47 -0500, "Bill Youngman" <(E-Mail Removed)> wrote:

¤ 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)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeze Excel Spreadsheet till template open first then spreadsheet learning_codes@hotmail.com Microsoft Excel Discussion 1 26th Oct 2008 03:56 PM
open excel spreadsheet file with windows xp =?Utf-8?B?U3lsdmVzdGVyIEouTGFudHo=?= Microsoft Access 2 7th Jul 2005 03:32 AM
windows explorer will not open an excel spreadsheet. =?Utf-8?B?aGFs?= Microsoft Excel Misc 2 24th Jun 2005 02:07 AM
Windows cant open excel spreadsheet.xls? =?Utf-8?B?c3V6eQ==?= Microsoft Excel Worksheet Functions 1 18th Jun 2005 09:13 PM
Re: How to open another Excel spreadsheet to copy data into current spreadsheet ? Ricky Pang Microsoft Excel Programming 0 13th Jul 2003 01:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:12 AM.