473,545 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New thread - not same credentials?

I upload an excel file, save it on the webserver and import the contents to
an MSSQL database.
I use the MS JET OleDb provider to read from the excel file. If I do this
during the HTTP
request this works fine. If however I let another thread (from a pool I've
created when
the ASP.NET application was first started) do the job, the OleDb provider
returns E_FAIL.
If I give Everyone full rights on the file, it works when the new thread is
used.
This is on a Windows Server 2003 btw. When the file is uploaded, it receives
Special (Allow List folder / Read data, Allow Delete) for NETWORK SERVICE.
The ASPNET user is not in the ACL. How can I solve this problem?

Casper
Nov 18 '05 #1
1 1037
It should not be working for you at all. Well at least, that's the mind set
you should have because you've violated a major thread law here. Threads are
not allowed to tamper with objects belonging to the main thread. The main
thread owns the http object, your worker thread does not. Results will
typically be flakey, working sometimes, failing at others because of the way
requests are scheduled underneath the hood.

To work around this, you can try passing a reference to the http object to
the worker thread. This will allow the worker thread to safely modify the
object and guarantee consitency. So from the pool of threads you created,
let one of the parameters be a httpcontext object.

--
Regards,
Alvin Bruney
Got Tidbits? Get it here
www.networkip.net/tidbits
"Casper Hornstrup" <ch@csite.com > wrote in message
news:ui******** ******@tk2msftn gp13.phx.gbl...
I upload an excel file, save it on the webserver and import the contents to an MSSQL database.
I use the MS JET OleDb provider to read from the excel file. If I do this
during the HTTP
request this works fine. If however I let another thread (from a pool I've
created when
the ASP.NET application was first started) do the job, the OleDb provider
returns E_FAIL.
If I give Everyone full rights on the file, it works when the new thread is used.
This is on a Windows Server 2003 btw. When the file is uploaded, it receives Special (Allow List folder / Read data, Allow Delete) for NETWORK SERVICE.
The ASPNET user is not in the ACL. How can I solve this problem?

Casper

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1252
by: Makarand Keer | last post by:
Hi all Gurus I have asp.net application where I am creating background process using Threading. My threading involves invoking method which in turn gets some data from SQL server using Windows Authentication. But when I run my app, connection error comes as "{"Login failed for user '(null)'. Reason: Not associated with a trusted SQL...
0
848
by: Jorge Filipe Barreiros | last post by:
I have a .net web application that calls a .net web service with the credentials of the windows logged user on the web application using impersonate. Everything's ok here. There's a very big operation that i have to do calling serveral functions on the web service that has to be done in a background thread because of the time spent in doing...
5
5734
by: Brian | last post by:
I have an file based asp.net application the creates a thread to do some background printing. It works fine but when the application is deployed on a web server, the following error occurs in the thread when it accesses SQL: Login failed for user ''. The user is not associated with a trusted SQL Server connection. Note the blank user. It...
0
857
by: =?Utf-8?B?cGxleDRy?= | last post by:
How can I start a new thread that has the same security credentials as the parent thread. I am working in and asp.net application where I want to spawn a new thread to get some data from a remote system. I am using Sharepoint and currently parent thread can access sql server but the child cannot. Thanks!
0
7484
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7415
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7928
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5344
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1902
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.