List Info

Thread: SystemUnAuthorizedException: Access is denied.




SystemUnAuthorizedException: Access is denied.
user name
2006-06-08 14:35:27
Anoop:
I'm not sure I can help you much with your issue
instantiating Excel from
your code.This list aims more at ASP.NET administration than
programming and
it might be better to post this particular query in an
ASP.NET programming
forum.

It does seem, however, that you're not experiencing a
permissions issue but
rather are seeing an issue with getting an instance of Excel
programatically. Instead of using CreateObject, maybe you
should add a COM
reference in your project to the Microsoft.Excel.10.0 Object
Library and use
a strongly typed reference to get an instance of Excel so
you can read your
file. I'm not sure that'll work but it might indicate part
of your issue if
you can't find the appropriate COM library in the COM tab
of your references
dialog box.

Jason

----- Original Message ----- 
From: "anoop" <anoop.jaiswalmind-infotech.com>
To: <aspnet-adminaspadvice.com>
Sent: Wednesday, June 07, 2006 9:54 PM
Subject: [aspnet-admin] RE: SystemUnAuthorizedException:
Access is denied.


> Thanks for the reply..........As per the security
matter I have added the
> users Adminstrators,Everyone, internetusers and aspnets
users with full
> control, but all in vein, whenever my server script
trying to create the
> instance of the excel application it throws an
exception.
>
> The code what I have written is as below..........
>
>
> Function GetExcelData(strFileName as string)
>
> ---------------------
>
> If Not File.Exists(strFileName) Then
>                 GetExcelData = "N$File does not
exist : " & strFileName
>                 Exit Function
>             End If
>
>             objExcel =
CType(CreateObject("Excel.Application"),
> Excel.Application)
>             objWorkbook =
CType(objExcel.Workbooks.Open(strFileName),
> Excel.Workbook)
>             objSheet = CType(objWorkbook.Sheets(1),
Excel.Worksheet)
>
>
> ----------------------------------
> End function
>
> I didn't understand when there is no issue while
uploading the file in the
> folder then why an exception to creating instance the
excel application on
> the server itself to read that file or is there another
way to read the
> excel file from server folder ??
>
> Thanks & Regards
>
> Anoop Jaiswal
> Soft. Engg.
> MothersonSumi INotech & Design Ltd.
> (A SEI CMM Level5 Company)
> B-7,Sector-7
> Noida,U.P.-201301
> Tel. No: +91-120-4365570
>
> -----Original Message-----
> From: Jason Cox [mailto:jcoxcoxinnovations.com]
> Sent: Wednesday, June 07, 2006 9:41 PM
> To: aspnet-adminaspadvice.com
> Subject: [aspnet-admin] RE:
SystemUnAuthorizedException: Access is denied.
>
> Anoop:
> The ASP.NET worker process runs under a certain
security context depending
> on a number of configuration parameters. By default, it
uses the local
> ASPNET account on the web server for Win 2K and IIS 5
or the local IIS_WPG
> group for Win 2003 and IIS 6. By default, the
privileges given to this
> user/group is very restricted and thus is probably the
source of your
> permissions issue. You should explicitly grant Read to
the appropriate
> account or group on the folder on the server where
you're uploading the
file
> to avoid the UnauthorizedException.
>
> Impersonation behaves differently because it actually
runs the ASP.NET
> requests under the account context of the currently
logged-in interactive
> user. Of course, you must have Anonymous auth turned
off and Integrated
auth
> turned on in IIS (on the website, application or
virtual directory) for
this
> to work but it means the resource you're accessing (in
this case, the
Excel
> file) is coming in under the logged-in user's security
context and not the
> ASPNET account or IIS_WPG group.
>
> If you configure the ACL correctly on your Excel upload
folder then you
> should be able to turn impersonation off on your web
application. At least
> that's what I've seen in my experience.
>
> Good luck!
>
> Jason
>
> ----- Original Message -----
> From: "anoop" <anoop.jaiswalmind-infotech.com>
> To: <aspnet-adminaspadvice.com>
> Sent: Wednesday, June 07, 2006 8:58 AM
> Subject: [aspnet-admin] SystemUnAuthorizedException:
Access is denied.
>
>
> > Hi All,
> >
> > I am new to web development and I am devloping a
web page using vs net
> 2003
> >
> > I had written a method and call it on my page
through java script.
> >
> > In the method I am creating new excel object to
read the uploaded excel
> file
> > on the server, but it throws an error of
SystemUnAuthorizedException:
> Access
> > is denied.
> >
> > The folder has all possible users and full access
to those users.
> >
> > but when I add <identity impersonation=true>
in my web.config file it
> works
> > fine on my system and return value also,
> > but with this setting when I run the page from
another user machine the
> > value return by the script is null.
> >
> > Is there any setting on server to read the
uploaded file on the server
> > folder?
> >
> > Thanks in advance for suggestions.
> >
> >
> >
> > Thanks & Regards
> >
> > Anoop Jaiswal
> > Soft. Engg.
> > MothersonSumi INotech & Design Ltd.
> > (A SEI CMM Level5 Company)
> > B-7,Sector-7
> > Noida,U.P.-201301
> > Tel. No: +91-120-4365570
> >
> >
> >
> >
> > Need SQL Advice? http://sqladvice.com
> > Need RegEx Advice? http://regexadvice.com
> > Need XML Advice? http://xmladvice.com
> >
>
>
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>
>
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>



Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )